Progress:
Changes

Summary

  1. [Clang] Fix LTO pipeline test after 770a50b28c00211f9a. (details)
  2. [clangd] cleanup of header guard names (details)
  3. [InstCombine] add tests for icmp with mul op; NFC (details)
  4. [OpenMP] Make the new device runtime the default (details)
  5. [TLI checker] Add more tests (details)
  6. [clang] Do not duplicate "EnableSplitLTOUnit" module flag (details)
  7. Revert "[TLI checker] Add more tests" (details)
  8. [lld][WebAssembly] Fix for debug relocations against undefined function symbols (details)
  9. tsan: fix false positives in dynamic libs with static tls (details)
  10. [SLP]Improve registering and merging of compatible shuffles. (details)
  11. tsan: tolerate munmap with invalid arguments (details)
  12. Reapply "[TLI checker] Add more tests" (details)
  13. [clang-cl] Define _MSVC_LANG for -std=c++2b (details)
  14. [ARM] Introduce i8neg and i8pos addressing modes (details)
  15. [SLP]Outline and fix code for finding common insertelement vectors. (details)
  16. [llvm] Fix "unused variable" warnings (details)
  17. [llvm] Use range-based for loops (NFC) (details)
  18. [OpenMP] Remove the new runtime default for AMDGPU (details)
  19. [DSE] Read after strcpy test. (details)
  20. [BasicAA] Add tests for strcat/strncat/strcpy. (details)
  21. [bazel][mlgo] Remove the mlgo-related build excludes (details)
  22. [lldb] Skip two lldb tests on Windows because they are flaky (details)
  23. [sanitizer] DEFINE_REAL_PTHREAD_FUNCTIONS for hwasan, lsan, msan (details)
  24. [ELF] Fix driver.test after 8c3641d0 when cwd is readonly (details)
Commit 89d645dd3a60cd5bb3cc9a78ad17d3b063cc98bf by flo
[Clang] Fix LTO pipeline test after 770a50b28c00211f9a.
The file was modifiedclang/test/CodeGen/lto-newpm-pipeline.c
Commit 5bd643d31d11e96bcae833025b241681370e527c by kuhnel
[clangd] cleanup of header guard names

Renaming header guards to match the LLVM convention.
This patch was created by automatically applying the fixes from
clang-tidy.

I've removed the [NFC]  tag from the title, as we're adding header guards in some files and thus might trigger behavior changes.

Differential Revision: https://reviews.llvm.org/D113896
The file was modifiedclang-tools-extra/clangd/CollectMacros.h
The file was modifiedclang-tools-extra/clangd/InlayHints.h
The file was modifiedclang-tools-extra/clangd/PathMapping.h
The file was modifiedclang-tools-extra/clangd/index/IndexAction.h
The file was modifiedclang-tools-extra/clangd/refactor/Tweak.h
The file was modifiedclang-tools-extra/clangd/unittests/TestFS.h
The file was modifiedclang-tools-extra/clangd/index/remote/Client.h
The file was modifiedclang-tools-extra/clangd/unittests/SyncAPI.h
The file was removedclang-tools-extra/clangd/unittests/TestScheme.h
The file was modifiedclang-tools-extra/clangd/unittests/TestTU.h
The file was modifiedclang-tools-extra/clangd/IncludeCleaner.h
The file was modifiedclang-tools-extra/clangd/index/CanonicalIncludes.h
The file was modifiedclang-tools-extra/clangd/index/Serialization.h
The file was modifiedclang-tools-extra/clangd/index/SymbolLocation.h
The file was modifiedclang-tools-extra/clangd/unittests/Matchers.h
The file was modifiedclang-tools-extra/clangd/index/BackgroundRebuild.h
The file was modifiedclang-tools-extra/clangd/HeuristicResolver.h
The file was modifiedclang-tools-extra/clangd/unittests/LSPClient.h
The file was modifiedclang-tools-extra/clangd/unittests/TestIndex.h
The file was modifiedclang-tools-extra/clangd/ExpectedTypes.h
The file was modifiedclang-tools-extra/clangd/index/SymbolOrigin.h
The file was modifiedclang-tools-extra/clangd/URI.h
The file was modifiedclang-tools-extra/clangd/unittests/Annotations.h
The file was modifiedclang-tools-extra/clangd/HeaderSourceSwitch.h
The file was modifiedclang-tools-extra/clangd/unittests/TestWorkspace.h
The file was modifiedclang-tools-extra/clangd/IncludeFixer.h
The file was modifiedclang-tools-extra/clangd/index/SymbolCollector.h
The file was modifiedclang-tools-extra/clangd/unittests/support/TestTracer.h
The file was modifiedclang-tools-extra/clangd/FindTarget.h
The file was modifiedclang-tools-extra/clangd/index/ProjectAware.h
The file was modifiedclang-tools-extra/clangd/index/dex/Trigram.h
The file was modifiedclang-tools-extra/clangd/index/BackgroundIndexLoader.h
The file was modifiedclang-tools-extra/clangd/index/dex/Token.h
The file was modifiedclang-tools-extra/clangd/unittests/tweaks/TweakTesting.h
Commit 3f8edce44707c93aa40602c75382bd79b2f57813 by spatel
[InstCombine] add tests for icmp with mul op; NFC
The file was modifiedllvm/test/Transforms/InstCombine/icmp-mul.ll
Commit c99407e31c3977bf397531bf115a63b0fda68e4d by jhuber6
[OpenMP] Make the new device runtime the default

This patch changes the `-fopenmp-target-new-runtime` option which controls if
the new or old device runtime is used to be true by default.  Disabling this to
use the old runtime now requires using `-fno-openmp-target-new-runtime`.

Reviewed By: JonChesterfield, tianshilei1992, gregrodgers, ronlieb

Differential Revision: https://reviews.llvm.org/D114890
The file was modifiedclang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/test/Driver/openmp-offload-gpu.c
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/lib/Driver/ToolChains/Cuda.cpp
The file was modifiedclang/test/Driver/amdgpu-openmp-toolchain.c
Commit 2778554971dada8ef7df9ee6954c52a753d90c22 by paul.robinson
[TLI checker] Add more tests

D114478 identified testing gaps; this patch fills them.

Differential Revision: https://reviews.llvm.org/D114913
The file was addedllvm/test/tools/llvm-tli-checker/multi-file.yaml
The file was addedllvm/test/tools/llvm-tli-checker/coff-reject.test
The file was addedllvm/test/tools/llvm-tli-checker/error-cases.test
The file was modifiedllvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
Commit 53adfa8750eaf4558c41a50f699616545eb0151b by david.greene
[clang] Do not duplicate "EnableSplitLTOUnit" module flag

If clang's output is set to bitcode and LTO is enabled, clang would
unconditionally add the flag to the module.  Unfortunately, if the input were a
bitcode or IR file and had the flag set, this would result in two copies of the
flag, which is illegal IR.  Guard the setting of the flag by checking whether it
already exists.  This follows existing practice for the related "ThinLTO" module
flag.

Differential Revision: https://reviews.llvm.org/D112177
The file was addedclang/test/CodeGen/enable-split-lto-unit.ll
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp
Commit 8cd61aac0030b8add686a98b8902ea49ec9c1deb by paul.robinson
Revert "[TLI checker] Add more tests"

This reverts commit 2778554971dada8ef7df9ee6954c52a753d90c22.

Some bots are failing on the updated tests.
The file was removedllvm/test/tools/llvm-tli-checker/multi-file.yaml
The file was removedllvm/test/tools/llvm-tli-checker/coff-reject.test
The file was modifiedllvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
The file was removedllvm/test/tools/llvm-tli-checker/error-cases.test
Commit 6f5c5cbe5f8209de3f4d91de75d7f3a716e9f131 by sbc
[lld][WebAssembly] Fix for debug relocations against undefined function symbols

This is very similar to https://reviews.llvm.org/D103557 but applies to
symbols which are undefined at link time rather than compile time.

We already have code that handles symbols which were defined at link
time but dead stripped by `--gc-sections` (See
`test/wasm/debug-removed-fn.ll`). In that case the symbols are not live
(!isLive()).  However, we can also have live symbols (which are
references by the program) but which are undefined at link time and are
imported by the linker.

In the test case here the symbol `undef` is used but is not defined
in the program but is imported by the linker due to the
`--import-undefined` flag.

Fixes: https://github.com/emscripten-core/emscripten/issues/15528

Differential Revision: https://reviews.llvm.org/D114921
The file was addedlld/test/wasm/debug-undefined-fs.s
The file was modifiedlld/wasm/InputFiles.cpp
Commit 97b4e631173a5f2f1f79361f9fc56c8f85681f73 by dvyukov
tsan: fix false positives in dynamic libs with static tls

The added test demonstrates  loading a dynamic library with static TLS.
Such static TLS is a hack that allows a dynamic library to have faster TLS,
but it can be loaded only iff all threads happened to allocate some excess
of static TLS space for whatever reason. If it's not the case loading fails with:

dlopen: cannot load any more object with static TLS

We used to produce a false positive because dlopen will write into TLS
of all existing threads to initialize/zero TLS region for the loaded library.
And this appears to be racing with initialization of TLS in the thread
since we model a write into the whole static TLS region (we don't what part
of it is currently unused):

WARNING: ThreadSanitizer: data race (pid=2317365)
  Write of size 1 at 0x7f1fa9bfcdd7 by main thread:
    0 memset
    1 init_one_static_tls
    2 __pthread_init_static_tls
    [[ this is where main calls dlopen ]]
    3 main
  Previous write of size 8 at 0x7f1fa9bfcdd0 by thread T1:
    0 __tsan_tls_initialization

Fix this by ignoring accesses during dlopen.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D114953
The file was modifiedcompiler-rt/lib/memprof/memprof_interceptors.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
The file was modifiedcompiler-rt/lib/asan/asan_interceptors.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
The file was addedcompiler-rt/test/tsan/Linux/dlopen_static_tls.cpp
Commit 92fbd76af525095197188c862db2c4f5b96a8a73 by a.bataev
[SLP]Improve registering and merging of compatible shuffles.

If several shuffle instructions are emitted, some of them might
same/compatible (less defined) with the previously emitted ones. Such
shuffles can be removed safely, improving the total cost of the
vectorized code.

Differential Revision: https://reviews.llvm.org/D114087
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/diamond_broadcast_extra_shuffle.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/gather-move-out-of-loop.ll
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Commit 1b576585eba4d08d5c97c39f5f43d0bf6eed4e4e by dvyukov
tsan: tolerate munmap with invalid arguments

We call UnmapShadow before the actual munmap, at that point we don't yet
know if the provided address/size are sane. We can't call UnmapShadow
after the actual munmap becuase at that point the memory range can
already be reused for something else, so we can't rely on the munmap
return value to understand is the values are sane.
While calling munmap with insane values (non-canonical address, negative
size, etc) is an error, the kernel won't crash. We must also try to not
crash as the failure mode is very confusing (paging fault inside of the
runtime on some derived shadow address).

Such invalid arguments are observed on Chromium tests:
https://bugs.chromium.org/p/chromium/issues/detail?id=1275581

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D114944
The file was addedcompiler-rt/test/tsan/munmap_invalid.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.cpp
Commit d3fe1c1583a54ae6e2a99713da1428ef9f282441 by paul.robinson
Reapply "[TLI checker] Add more tests"

This reverts commit 8cd61aac0030b8add686a98b8902ea49ec9c1deb.
I had missed one place in a test that needed updating; it passed on my
dirty build tree but not on a clean one.

Original commit message:

D114478 identified testing gaps; this patch fills them.

Differential Revision: https://reviews.llvm.org/D114913
The file was addedllvm/test/tools/llvm-tli-checker/error-cases.test
The file was modifiedllvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
The file was addedllvm/test/tools/llvm-tli-checker/coff-reject.test
The file was addedllvm/test/tools/llvm-tli-checker/multi-file.yaml
Commit 2a2b3a3e3df7b89e18be9ffab1e08d7ca578cf57 by thakis
[clang-cl] Define _MSVC_LANG for -std=c++2b

This matches the value that msvc v19.29 VS16.11 uses for
_MSVC_LANG with /std:c++latest.

Differential Revision: https://reviews.llvm.org/D114952
The file was modifiedclang/lib/Basic/Targets/OSTargets.cpp
The file was modifiedclang/test/Preprocessor/predefined-win-macros.c
Commit b8f1ccb0acf8dccdd3fb706465ec958763987bee by david.green
[ARM] Introduce i8neg and i8pos addressing modes

Some instructions with i8 immediate ranges can only hold negative values
(like t2LDRHi8), only hold positive values (like t2STRT) or hold +/-
depending on the U bit (like the pre/post inc instructions. e.g
t2LDRH_POST). This patch splits the AddrModeT2_i8 into AddrModeT2_i8,
AddrModeT2_i8pos and AddrModeT2_i8neg to make this clear.

This allows us to get the offset ranges of t2LDRHi8 correct in the
load/store optimizer, fixing issues where we could end up creating
instructions with positive offsets (which may then be encoded as ldrht).

Differential Revision: https://reviews.llvm.org/D114638
The file was modifiedllvm/lib/Target/ARM/ARMInstrFormats.td
The file was modifiedllvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h
The file was modifiedllvm/test/CodeGen/Thumb2/postinc-distribute.mir
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
The file was modifiedllvm/lib/Target/ARM/Thumb2InstrInfo.cpp
The file was modifiedllvm/test/CodeGen/ARM/machine-outliner-stack-fixup-thumb.mir
The file was modifiedllvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.h
The file was modifiedllvm/lib/Target/ARM/ARMFrameLowering.cpp
The file was modifiedllvm/lib/Target/ARM/ARMInstrThumb2.td
Commit 8ceccbd321319434450717ac1917cdca174ff6eb by a.bataev
[SLP]Outline and fix code for finding common insertelement vectors.

Need to outline the code for finding common vectors in insertelement
instructions into a separate function for future patches. It also
improves the process by adding some extra checks for early exit and
fixes a bug where it always finds the match because of erroneous compare
of the same values.

Differential Revision: https://reviews.llvm.org/D114909
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/cmp_commute-inseltpoison.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/cmp_commute.ll
Commit 22d82949b091ad83522c001b564adee5e6f280f4 by kazu
[llvm] Fix "unused variable" warnings
The file was modifiedllvm/lib/ExecutionEngine/Orc/Core.cpp
The file was modifiedllvm/lib/Transforms/Utils/SampleProfileInference.cpp
Commit 262dd1e42d719d2bd3fa18233500204c6950cede by kazu
[llvm] Use range-based for loops (NFC)
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp
The file was modifiedllvm/lib/MC/MCAsmStreamer.cpp
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
The file was modifiedllvm/lib/Option/OptTable.cpp
The file was modifiedllvm/lib/Support/StringExtras.cpp
The file was modifiedllvm/lib/Support/Regex.cpp
The file was modifiedllvm/lib/IR/AsmWriter.cpp
The file was modifiedllvm/lib/Support/StringRef.cpp
The file was modifiedllvm/lib/Target/NVPTX/NVPTXAssignValidGlobalNames.cpp
Commit 96ff74a0d5982cb70ac25883f3b0d5bb99947aa9 by jhuber6
[OpenMP] Remove the new runtime default for AMDGPU

The new runtime is currently broken for AMD offloading. This patch makes
the default the old runtime only for the AMD target.

Reviewed By: ronlieb

Differential Revision: https://reviews.llvm.org/D114965
The file was modifiedclang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
Commit 68782a860dfa680697cf5748f2609624e933fcbb by flo
[DSE] Read after strcpy test.
The file was modifiedllvm/test/Transforms/DeadStoreElimination/libcalls.ll
Commit 222442ec2d7172faedf20291f5d14f4883b5fa1b by flo
[BasicAA] Add tests for strcat/strncat/strcpy.
The file was modifiedllvm/test/Analysis/BasicAA/libfuncs.ll
Commit ced5fd8dbf903b07de3ad9fee9323a9e423fc7c1 by mtrofin
[bazel][mlgo] Remove the mlgo-related build excludes

They aren't needed anymore, we handle conditional compilation in those
files.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D114970
The file was modifiedutils/bazel/llvm-project-overlay/llvm/BUILD.bazel
Commit c24860118a7e4fe0611a9463498181a4a01b9459 by stilis
[lldb] Skip two lldb tests on Windows because they are flaky

These tests work fine with VS2017, but become more flaky with VS2019 and the buildbot is about to get upgraded.

Differential Revision: https://reviews.llvm.org/D114907
The file was modifiedlldb/test/API/python_api/lldbutil/iter/TestLLDBIterator.py
The file was modifiedlldb/test/API/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
Commit 323bfad72dee67989cbcb3b151e3a3b295f56b41 by Vitaly Buka
[sanitizer] DEFINE_REAL_PTHREAD_FUNCTIONS for hwasan, lsan, msan

It should be NFC, as they already intercept pthread_create.

This will let us to fix BackgroundThread for these sanitizerts.
In in followup patches I will fix MaybeStartBackgroudThread for them
and corresponding tests.

Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D114935
The file was modifiedcompiler-rt/lib/msan/msan_interceptors.cpp
The file was modifiedcompiler-rt/lib/lsan/lsan_interceptors.cpp
The file was modifiedcompiler-rt/lib/hwasan/hwasan_interceptors.cpp
Commit 8270ff86a10b01ae62c24b17624b4219c119b36d by rnk
[ELF] Fix driver.test after 8c3641d0 when cwd is readonly
The file was modifiedlld/test/ELF/driver.test