Changes

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [tsan] Fix Darwin build after D106973 (details)
  2. Revert "[tsan] Fix Darwin build after D106973" (details)
  3. [tsan] Fix Darwin build after D106973 (details)
  4. NFC: Adapt operation.py to builtin operation print format changes. (details)
  5. Emit strong definition for TypeID storage in Op/Type/Attributes definition (details)
  6. Break apart the MLIR ExecutionEngine from core python module. (details)
  7. [AArch64][GlobalISel] Improve legalization for odd-type G_LOAD (details)
  8. [llvm-objcopy][MachO] Ignore all LC_SUB_* commands. (details)
  9. [libFuzzer] Fix CFI Directives for fuchsia (details)
  10. [asan][fuchsia] Implement PlatformUnpoisonStacks (details)
  11. [ThinLTO] Disallow importing for functions with indir branch to block address (details)
  12. [libc++] Implement the resolutions of LWG3506 and LWG3522. (details)
  13. [RISCV][test] Add new tests for mul optimization in the zba extension with SH*ADD (details)
  14. [RISCV] Optimize mul in the zba extension with SH*ADD (details)
  15. [MBP] findBestLoopTopHelper should exit if OldTop is not a chain header (details)
  16. [libc++] money_get::do_get() set failbit and eofbit if iterator begin equals end (details)
  17. [libc++] Remove unused variables in generate_private_header_tests.py. NFCI. (details)
  18. [libc++][modularisation] Split <compare> into internal headers. (details)
  19. [gn build] Port 61c35fb0c2c9 (details)
  20. NFC: Add missing import to integration test. (details)
  21. Update file names and extensions for MLIR Python execution engine changes. (details)
  22. [Preprocessor] -E -P: Ensure newline after 8 skipped lines. (details)
  23. libcang: Add missing function to libclang.map (details)
  24. [libc][NFC] Add noreturn and constexpr qualifiers where appropriate (details)
  25. [test] Fix tools/gold/X86/comdat-nodeduplicate.ll on non-X86 hosts (details)
  26. Add `all_of_zip` to STLExtras (details)
  27. Implement recursive support into OperationEquivalence::isEquivalentTo() (details)
  28. [NFC][X86] add missing tests in clang/test/CodeGen/attr-target-mv.c (details)
  29. [libc++] Remove excess whitespace in synopsis comment. NFCI. (details)
  30. tsan: fix java_symbolization test (details)
  31. tsan: remove /**/ at the of multi-line macros (details)
  32. tsan: switch from SSE3 to SSE4.2 (details)
  33. [NFC][InstSimplify] Use more intuitive variable names. (details)
  34. [libcxx][doc] Update the build documentation. (details)
  35. [clang-format] Fix aligning with linebreaks #2 (details)
  36. test-release.sh: Kill python2 (details)
  37. [RISCV] Add test case showing suboptimal BUILD_VECTOR lowering (details)
  38. [RISCV] Optimize floating-point "dominant value" BUILD_VECTORs (details)
  39. [LoopFlatten] Fix missed LoopFlatten opportunity (details)
  40. Fix FindZ3.cmake to support static libraries and Windows (details)
  41. [mlir] Remove the default isDynamicallyLegal hook (details)
  42. [mlir] Put back virtual ~ConversionTarget(), some users started relying on it (details)
  43. [AMDGPU][GlobalISel] Insert an and with exec before s_cbranch_vccnz if necessary (details)
  44. [lldb][AArch64] Annotate synchronous tag faults (details)
  45. NFC: Change quotes from Unicode to ASCII (details)
  46. [AArch64][GlobalISel] More widenToNextPow2 changes, this time for arithmetic/bitwise ops. (details)
  47. [AArch64][AsmParser] NFC: Parser.getTok() -> getTok() (details)
  48. [flang][driver] Forward `-fopenmp`/`-fopenacc` to the host compiler (details)
  49. tsan: rename deadlock detector Mutex to UserMutex (details)
  50. sanitizer_common: remove BlockingMutex and RWMutex (details)
  51. tsan: store ThreadRegistry in Context by value (details)
  52. Follow-up to D105207, only salvage affine SCEVs to avoid a crash (details)
  53. bugprone-forwarding-reference-overload: support non-type template parameters (details)
  54. [Utils] Do not remove comments in llc test script (details)
Commit 6a0fe68844150f16e16fe64d050509e4ba740d98 by Vitaly Buka
[tsan] Fix Darwin build after D106973
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp
Commit d42a06b2006ec5838ab6b065353597ac7c7add72 by Vitaly Buka
Revert "[tsan] Fix Darwin build after D106973"

It was invalid fix.

This reverts commit 6a0fe68844150f16e16fe64d050509e4ba740d98.
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp
Commit ca7c66ccb85b9468ba86ad12d91c940e4cb72dc3 by Vitaly Buka
[tsan] Fix Darwin build after D106973
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp
Commit dad10a9afbc383076bfa273f151de9e7bdb94eda by stellaraccident
NFC: Adapt operation.py to builtin operation print format changes.
The file was modifiedmlir/test/python/ir/operation.py
Commit 4bb0ad2382a1224c876dfd3671cf994a1a50e10d by joker.eph
Emit strong definition for TypeID storage in Op/Type/Attributes definition

By making an explicit template specialization for the TypeID provided by these classes,
the compiler will not emit an inline weak definition and rely on the linker to unique it.
Instead a single definition will be emitted in the C++ file alongside the implementation
for these classes. That will turn into a linker error what is now a hard-to-debug runtime
behavior where instances of the same class may be using a different TypeID inside of
different DSOs.

Recommit 660a56956c32b0bcd850fc12fa8ad0225a6bb880 after fixing gcc5
build.

Differential Revision: https://reviews.llvm.org/D105903
The file was modifiedmlir/include/mlir/Support/TypeID.h
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
The file was modifiedmlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
The file was modifiedmlir/tools/mlir-tblgen/DialectGen.cpp
Commit 0cdf4915019a8ebc6570229cf140ad879dfaef56 by stellaraccident
Break apart the MLIR ExecutionEngine from core python module.

* For python projects that don't need JIT/ExecutionEngine, cuts the number of files to compile roughly in half (with similar reduction in end binary size).

Differential Revision: https://reviews.llvm.org/D106992
The file was removedmlir/lib/Bindings/Python/ExecutionEngine.h
The file was addedmlir/lib/Bindings/Python/ExecutionEngineModule.cpp
The file was modifiedmlir/lib/Bindings/Python/MainModule.cpp
The file was modifiedmlir/python/mlir/execution_engine.py
The file was modifiedmlir/test/python/execution_engine.py
The file was removedmlir/lib/Bindings/Python/ExecutionEngine.cpp
The file was modifiedmlir/python/CMakeLists.txt
Commit 5a333dc5da9fac3407b78d52ad3bc18049f8a73b by Jessica Paquette
[AArch64][GlobalISel] Improve legalization for odd-type G_LOAD

Swap the order of widening so that we widen to the next power-of-2 first when
legalizing G_LOAD.

Also, provide a minimum type for the power of 2 to disallow s2 + s1. Clamping
ought to disallow s2 and s1, but I think it's better to be explicit about the
expected minimum size.

We probably need a similar change for G_STORE, but it seems to be a bit more
finnicky. So, let's just handle G_LOAD for now.

Differential Revision: https://reviews.llvm.org/D107013
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir
Commit d6704e5ed91478464e551ee9d5520584978553ee by danielrodriguez
[llvm-objcopy][MachO] Ignore all LC_SUB_* commands.

The LC_SUB_FRAMEWORK, LC_SUB_UMBRELLA, LC_SUB_CLIENT, and LC_SUB_LIBRARY
are used to indicate related libraries, binaries or framework names.
Their only payload is the string with the name of the object. Adding
those commands to the list of ignored/skipped load commands will avoid
an error that stop the process of copying/stripping and will copy their
contents verbatim.

Additionally, in order to have a test for this case, `yaml2obj` now
allows those four commands to contain a `Content`.

Differential Revision: https://reviews.llvm.org/D106412
The file was modifiedllvm/lib/ObjectYAML/MachOYAML.cpp
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp
The file was modifiedllvm/lib/ObjectYAML/MachOEmitter.cpp
The file was addedllvm/test/tools/llvm-objcopy/MachO/sub-load-commands.test
Commit a9c515983dc26992ce67668ad64f066353853ed1 by mvanotti
[libFuzzer] Fix CFI Directives for fuchsia

This commit fixes the CFI directives in the crash trampoline so
libunwind can get a backtrace during a crash.

In order to get a backtrace from a libfuzzer crash in fuchsia, we
resume execution in the crashed thread, forcing it to call the
StaticCrashHandler. We do this by setting a "crash trampoline" that has
all the necessary cfi directives for an unwinder to get full backtrace
for that thread.

Due to a bug in libunwind, it was not possible to restore the RSP
pointer, as it was always set to the call frame address (CFA). The
previous version worked around this issue by setting the CFA to the
value of the stack pointer at the point of the crash.

The bug in libunwind is now fixed[0], so I am correcting the CFI
annotations so that the CFA correctly points to the beginning of the
trampoline's call frame.

[0]: https://reviews.llvm.org/D106626

Reviewed By: mcgrathr

Differential Revision: https://reviews.llvm.org/D106725
The file was modifiedcompiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp
Commit c6ad3f2157ce374dbd2fd3e50699fc0303553714 by mvanotti
[asan][fuchsia] Implement PlatformUnpoisonStacks

This CL modifies the PlatformUnpoisonStacks so that fuchsia can
implement its own logic for unpoisoning the stacks.

For the general case, the behavior is the same as with regular asan: it
will unpoison everything from the current stack pointer until the base
of the stack (stack top).

In some situations, the current stack might not be the same as the
default stack. In those cases, the code will now unpoison the entire
default stack, and will also unpoison the current page of the stack.

Reviewed By: mcgrathr

Differential Revision: https://reviews.llvm.org/D106835
The file was modifiedcompiler-rt/lib/asan/asan_fuchsia.cpp
Commit 1a8087adaf1e34b695d420f62ff26d3d8489264d by aktoon
[ThinLTO] Disallow importing for functions with indir branch to block address

We don't allowing inlining for functions with blockaddress with uses other than strictly callbr. This is because if the blockaddress escapes the function via a global variable, inlining may lead to an invalid cross-function reference.

We check against such cases during inlining, however the check can fail for ThinLTO post-link because CFG simplification can incorrectly removes blocks based on wrong block reachability.

When we import a function with blockaddress taken in a global variable but without importing that variable, we won't go through value mapping to reflect the real address-taken-ness of the cloned blocks. For the imported clone, this leads to blocks reachable from indirect branch through global variable being incorrectly treated as unreachable and removed by SimplifyCFG.

Since inlining for such cases shouldn't be allowed in the first place, I'm marking them as ineligible for importing during pre-link to save the problem of missing address-taken-ness of imported clone as well as bad DCE and inlining.

Differential Revision: https://reviews.llvm.org/D106930
The file was modifiedllvm/test/ThinLTO/X86/globals-import-blockaddr.ll
The file was modifiedllvm/lib/Analysis/ModuleSummaryAnalysis.cpp
The file was modifiedllvm/test/ThinLTO/X86/Inputs/globals-import-blockaddr.ll
Commit 3894a8a4768fd6fa9bf18303a0db1687c7c687b3 by arthur.j.odwyer
[libc++] Implement the resolutions of LWG3506 and LWG3522.

Implement the changes in all language modes.

LWG3506 "Missing allocator-extended constructors for priority_queue"
makes the following changes:
- New allocator-extended constructors for priority_queue.
- New deduction guides targeting those constructors.

LWG3522: "Missing requirement on InputIterator template parameter
for priority_queue constructors". The iterator parameter should be
constrained to actually be an iterator type. `priority_queue{1,2}`
should be SFINAE-friendly ill-formed.

Also, do a drive-by fix in the allocator-extended move constructor:
there's no need to do a `make_heap` after moving from `__q.c` into
our own `c`, because that container was already heapified when it
was part of `__q`. [priqueue.cons.alloc] actually specifies the
behavior and does *not* mention calling `make_heap`. I think this
was just a copy-paste thinko. It dates back to the initial import
of libc++.

Differential Revision: https://reviews.llvm.org/D106824
Differential Revision: https://reviews.llvm.org/D106827
The file was addedlibcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_iter_iter_comp_alloc.pass.cpp
The file was addedlibcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_constraint.compile.pass.cpp
The file was modifiedlibcxx/include/queue
The file was addedlibcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_iter_iter_comp_cont_alloc.pass.cpp
The file was modifiedlibcxx/docs/Status/RangesIssues.csv
The file was modifiedlibcxx/docs/Status/Cxx2bIssues.csv
The file was addedlibcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_iter_iter_alloc.pass.cpp
The file was addedlibcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_iter_iter_comp_rcont_alloc.pass.cpp
The file was modifiedlibcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp
Commit 2a2d83d916aaed3dff1001366f1f7849082098e1 by powerman1st
[RISCV][test] Add new tests for mul optimization in the zba extension with SH*ADD

These test will show the following optimization by future patches.

(mul x, (power_of_2 + 2)) => (SH1ADD x, (SLLI x, bits))
(mul x, (power_of_2 + 4)) => (SH2ADD x, (SLLI x, bits))
(mul x, (power_of_2 + 8)) => (SH3ADD x, (SLLI x, bits))

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D106647
The file was modifiedllvm/test/CodeGen/RISCV/rv32zba.ll
The file was modifiedllvm/test/CodeGen/RISCV/rv64zba.ll
Commit 264b8e2a20b3124b80bdf6f17dc29d5869336375 by powerman1st
[RISCV] Optimize mul in the zba extension with SH*ADD

This patch makes the following optimization, if the
immediate multiplier is not a simm12.

(mul x, (power_of_2 + 2)) => (SH1ADD x, (SLLI x, bits))
(mul x, (power_of_2 + 4)) => (SH2ADD x, (SLLI x, bits))
(mul x, (power_of_2 + 8)) => (SH3ADD x, (SLLI x, bits))

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D106648
The file was modifiedllvm/test/CodeGen/RISCV/rv32zba.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was modifiedllvm/test/CodeGen/RISCV/rv64zba.ll
Commit 50b62731452cb83979bbf3c06e828d26a4698dca by carrot
[MBP] findBestLoopTopHelper should exit if OldTop is not a chain header

Function findBestLoopTopHelper tries to find a new loop top block which can also
fall through to OldTop, but it's impossible if OldTop is not a chain header, so
it should exit immediately.

Differential Revision: https://reviews.llvm.org/D106329
The file was modifiedllvm/lib/CodeGen/MachineBlockPlacement.cpp
The file was addedllvm/test/CodeGen/ARM/mbp.ll
Commit 363a8a05988de8f5771fd1330b0fa9a4d2ae4944 by jasonliu.development
[libc++] money_get::do_get() set failbit and eofbit if iterator begin equals end

Summary:
Currently, if we pass in the same iterator for begin and end,
the long double version of do_get would throw a runtime error.

However, according to standard (https://eel.is/c++draft/locale.money.get#virtuals-1),
we should set the failbit and eofbit when no more characters are available.

Differential Revision: https://reviews.llvm.org/D100510
The file was modifiedlibcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp
The file was modifiedlibcxx/include/locale
The file was modifiedlibcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp
Commit 20c6ddc5bcc91aba6a5cccabae094d08301567fc by arthur.j.odwyer
[libc++] Remove unused variables in generate_private_header_tests.py. NFCI.
The file was modifiedlibcxx/utils/generate_private_header_tests.py
Commit 61c35fb0c2c9e25942a913ea88f541dc5abb15e4 by arthur.j.odwyer
[libc++][modularisation] Split <compare> into internal headers.

Differential Revision: https://reviews.llvm.org/D106107
The file was modifiedlibcxx/include/compare
The file was addedlibcxx/include/__compare/ordering.h
The file was modifiedlibcxx/include/CMakeLists.txt
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/compare/common_comparison_category.module.verify.cpp
The file was addedlibcxx/include/__compare/common_comparison_category.h
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/compare/ordering.module.verify.cpp
The file was modifiedlibcxx/include/module.modulemap
Commit ecd5dc6dccfff44267fa57737311f1ed0a108870 by llvmgnsyncbot
[gn build] Port 61c35fb0c2c9
The file was modifiedllvm/utils/gn/secondary/libcxx/include/BUILD.gn
Commit 7e2174c2535edc03864b2016ff00e4bb57947a8f by stellaraccident
NFC: Add missing import to integration test.
The file was modifiedmlir/test/python/integration/dialects/linalg/opsrun.py
Commit 768f56264150ad20f0d1416314a0affafb55bd0f by stellaraccident
Update file names and extensions for MLIR Python execution engine changes.
The file was modifiedutils/bazel/llvm-project-overlay/mlir/BUILD.bazel
Commit c6b0b16c0f55c34f4eaa05184815bbbe97f4b750 by llvm-project
[Preprocessor] -E -P: Ensure newline after 8 skipped lines.

The implementation of -fminimize-whitespace (D104601) revised the logic
when to emit newlines. There was no case to handle when more than
8 lines were skippped in -P (DisableLineMarkers) mode and instead fell
through the case intended for -fminimize-whitespace, i.e. emit nothing.
This patch will emit one newline in this case.

The newline logic is slightly reorganized. The `-P -fminimize-whitespace`
case is handled explicitly and emitting at least one newline is the new
fallback case. The choice between emitting a line marker or up to
7 empty lines is now a choice only with enabled line markers. The up to
8 newlines likely are fewer characters than a line directive, but
in -P mode this had the paradoxic effect that it would print up to
7 empty lines, but none at all if more than 8 lines had to be skipped.
Now with DisableLineMarkers, we don't consider printing empty lines
(just start a new line) which matches gcc's behavior.

The line-directive-output-mincol.c test is replaced with a more
comprehensive test skip-empty-lines.c also testing the more than
8 skipped lines behaviour with all flag combinations.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D106924
The file was addedclang/test/Preprocessor/skip-empty-lines.c
The file was removedclang/test/Preprocessor/line-directive-output-mincol.c
The file was modifiedclang/lib/Frontend/PrintPreprocessedOutput.cpp
The file was modifiedclang/test/Preprocessor/minimize-whitespace.c
Commit a4edb2b1ba0bda9042e87ca3f3e1b9f70598df9a by tstellar
libcang: Add missing function to libclang.map

This function is marked with CINDEX_LINKAGE, but was never added to the
export list / linker script.

Reviewed By: jrtc27

Differential Revision: https://reviews.llvm.org/D106974
The file was modifiedclang/tools/libclang/libclang.map
Commit 640ed21cceb28ddb3a9779fdfa11a4c4d97e29df by sivachandra
[libc][NFC] Add noreturn and constexpr qualifiers where appropriate

These functions make it clear to the compiler and user what the intended
behavior is so llvm can make them go as fast as possible.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D106807
The file was modifiedlibc/utils/HdrGen/Command.h
The file was modifiedlibc/src/__support/integer_operations.h
The file was modifiedlibc/src/ctype/ctype_utils.h
Commit 5060224d9eed8b8359ed5090bb7c577b8575e9e7 by nathan
[test] Fix tools/gold/X86/comdat-nodeduplicate.ll on non-X86 hosts

When running this test on an aarch64 machine, it fails:

```
/usr/bin/ld.gold: error: .../test/tools/gold/X86/Output/comdat-nodeduplicate.ll.tmp/ab.lto.o: incompatible target
```

Specify the elf_x86_64 emulation as all of the other gold plugin tests
do.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D107020
The file was modifiedllvm/test/tools/gold/X86/comdat-nodeduplicate.ll
Commit b70de61f48062c7810b474bc944394ecbd56a262 by joker.eph
Add `all_of_zip` to STLExtras

This takes two ranges and invokes a predicate on the element-wise pair in the
ranges. It returns true if all the pairs are matching the predicate and the ranges
have the same size.
It is useful with containers that aren't random iterator where we can't check the
sizes in O(1).

Differential Revision: https://reviews.llvm.org/D106605
The file was modifiedllvm/include/llvm/ADT/STLExtras.h
The file was modifiedllvm/unittests/ADT/STLExtrasTest.cpp
Commit 0be5d1a96c8973a4aa56b3fdd8fc22c8a95a7171 by joker.eph
Implement recursive support into OperationEquivalence::isEquivalentTo()

This allows to use OperationEquivalence to track structural comparison for equality
between two operations.

Differential Revision: https://reviews.llvm.org/D106422
The file was modifiedmlir/lib/IR/OperationSupport.cpp
The file was modifiedmlir/lib/Transforms/Utils/RegionUtils.cpp
The file was addedmlir/test/lib/IR/TestOperationEquals.cpp
The file was modifiedmlir/lib/Transforms/CSE.cpp
The file was addedmlir/test/IR/operation-equality.mlir
The file was modifiedmlir/test/lib/IR/CMakeLists.txt
The file was modifiedmlir/include/mlir/IR/OperationSupport.h
The file was modifiedmlir/tools/mlir-opt/mlir-opt.cpp
Commit 58712987e56fb598ac49da7fbe6e6a78c787637b by freddy.ye
[NFC][X86] add missing tests in clang/test/CodeGen/attr-target-mv.c

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D106849
The file was modifiedclang/test/CodeGen/attr-target-mv.c
Commit d4840175c95f6edcba21baae411589468d5bc68f by arthur.j.odwyer
[libc++] Remove excess whitespace in synopsis comment. NFCI.
The file was modifiedlibcxx/include/compare
Commit 262cb5f5b492b77336e6dea3f720eec9632cced4 by dvyukov
tsan: fix java_symbolization test

We reliably remove bottom libc-guts frames only on linux/glibc.
Some bots failed on this test showing other bottom frames:

.annobin_libc_start.c libc-start.c (libc.so.6+0x249f4)
generic_start_main.isra.0 libc-start.c (libc.so.6+0x45b0c)

We can't reliably remove all of possible bottom frames.
So remove the assertion for that.

Differential Revision: https://reviews.llvm.org/D107037
The file was modifiedcompiler-rt/test/tsan/java_symbolization.cpp
Commit a1a37ddc3f0e4d4002b0661e4870b1e949fd5d81 by dvyukov
tsan: remove /**/ at the of multi-line macros

Prefer code readability over writeability.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D106982
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interface_java.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interface_ann.cpp
Commit cd0143c0f2a37332a1f7e29caa122db74b92a344 by dvyukov
tsan: switch from SSE3 to SSE4.2

Switch x86_64 requirement for optimized code from SSE3 to SSE4.2.
The new tsan runtime will need few instructions that are only
supported by SSE4:

_mm_max_epu32
_mm_extract_epi8
_mm_insert_epi32

SSE3 was introcued in 2004 and SSE4 in 2006:
https://en.wikipedia.org/wiki/SSE3
https://en.wikipedia.org/wiki/SSE4

We are still providing non-optimized C++ version of the code,
so either way it's possible to build tsan runtime for any CPU.

But for Go this will bump strict requirement for -race because
Go contains prebuilt versions and these will be built with -msse4.2.
But requiring a CPU produced at least in 2006 looks reasonable for
a debugging tool (more reasonable than disabling optimizations
for everybody).

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D106948
The file was modifiedcompiler-rt/lib/tsan/go/build.bat
The file was modifiedcompiler-rt/lib/tsan/go/buildgo.sh
The file was modifiedcompiler-rt/lib/tsan/CMakeLists.txt
Commit e2fe26e77b02633207bdd36a14e2dcf210cc2fe7 by JunMa
[NFC][InstSimplify] Use more intuitive variable names.
The file was modifiedllvm/test/Transforms/InstSimplify/fold-vscale.ll
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
Commit 92b758cf3d706b117d59490cd85d23b764cc749f by koraq
[libcxx][doc] Update the build documentation.

These are the hunks of
  D106770 [libc++][doc] Update the release notes
that are relevant for main.
The file was modifiedlibcxx/docs/BuildingLibcxx.rst
Commit 75f6a795ee0faf544c3f539d01008d1d5d876acb by bjoern
[clang-format] Fix aligning with linebreaks #2

This amends c5243c63cda3c740d6e9c7e501f6518c21688da3 to fix formatting
continued function calls with BinPacking = false.

Differential Revision: https://reviews.llvm.org/D106773
The file was modifiedclang/lib/Format/WhitespaceManager.cpp
The file was modifiedclang/unittests/Format/FormatTest.cpp
Commit 9ff030ca50e327d522e80ee20f4d5febcce94a24 by diana.picus
test-release.sh: Kill python2

Don't prefer python2's virtualenv when setting up the test-suite.
Always use python3 instead, since that's what we support everywhere else
anyway.

Differential Revision: https://reviews.llvm.org/D106941
The file was modifiedllvm/utils/release/test-release.sh
Commit a33f60db39836d94a79557b147515d42d30ecba3 by fraser
[RISCV] Add test case showing suboptimal BUILD_VECTOR lowering

The second test case added here was pointed out to me by @craig.topper
and shows how we "optimize" a two-element BUILD_VECTOR from being one
load from the constant pool to two loads from the constant pool.

The first test case shows that since materialization for the
floating-point +0.0 value is cheap and doesn't involve a load, the
optimization is more clearly beneficial here.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D106962
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-buildvec.ll
Commit 02dd4b59bc0d34ecd41fcc314f5571572b3feebc by fraser
[RISCV] Optimize floating-point "dominant value" BUILD_VECTORs

This patch aims to improve the performance of BUILD_VECTORs which are
identified as containing a dominant element. Given that most
floating-point constants themselves require a load from the constant
pool, it was possible for the optimization to actually increase the
number of individual loads on small vectors. The exception is the zero
constant -- +0.0 -- which can be materialized efficiently.

While this optimization could do with a proper cost model to weigh the
benfits of a single vector load vs. the manipulation of individual
elements -- even for integer vectors which often require several
instructions to materialize -- without a concrete RVV implementation to
work with any heuristic is likely to be both more obtuse and inaccurate.

Until then, this patch fixes at least one known obvious deficiency.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D106963
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-buildvec.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
Commit 2df8bf9339e43de63d8d28e07182e1d6d7ffb843 by rosie.sumpter
[LoopFlatten] Fix missed LoopFlatten opportunity

When the trip count of the inner loop is a constant, the InstCombine
pass now causes the transformation e.g. imcp ult i32 %inc, tripcount ->
icmp ult %j, tripcount-step (where %j is the inner loop induction
variable and %inc is add %j, step), which is now accounted for when
identifying the trip count of the loop. This is also an acceptable use
of %j (provided the step is 1) so is ignored as long as the compare
that it's used in is also the condition of the inner branch.

Differential Revision: https://reviews.llvm.org/D105802
The file was modifiedllvm/lib/Transforms/Scalar/LoopFlatten.cpp
The file was modifiedllvm/test/Transforms/LoopFlatten/loop-flatten.ll
The file was modifiedllvm/test/Transforms/LoopFlatten/loop-flatten-negative.ll
Commit f1ab60e40d16970381a003e145be6d5932823597 by balazs.benics
Fix FindZ3.cmake to support static libraries and Windows

Use absolute path to link z3 to allow builds both on windows and linux
since the library name is platform dependent for Z3 (libz3 on Windows
and z3 on Linux) and MSVC does not recognized -L and -l options.
Fix CMAKE_CROSSCOMPILING that does not work correctly since it uses
Z3_BUILD_VERSION instead of Z3_BUILD_NUMBER
Fix building with the static version of z3 library (supersedes D80227).

- Build the Z3 version detection code as C++, since the static
   library brings in libstdc++ symbols
- Detect threading support and link against threading, in the
   (likely) case Z3 was built with threads

Exposed compilation error from building a program that is used to detect
z3 version in the warning message, to simplify troubleshooting.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D106131
The file was modifiedllvm/cmake/modules/FindZ3.cmake
Commit 1c9c2c91d4d4b62d99ea1472de4d01eb7d7e6ee0 by benny.kra
[mlir] Remove the default isDynamicallyLegal hook

This is redundant with the callback variant and untested. Also remove
the callback-less methods for adding a dynamically legal op, as they
are no longer useful.

Differential Revision: https://reviews.llvm.org/D106786
The file was modifiedmlir/include/mlir/Transforms/DialectConversion.h
The file was modifiedmlir/docs/DialectConversion.md
The file was modifiedmlir/lib/Transforms/Utils/DialectConversion.cpp
Commit d81a843846f4171ffe3f44b66bf3a9fda5c411cf by benny.kra
[mlir] Put back virtual ~ConversionTarget(), some users started relying on it
The file was modifiedmlir/include/mlir/Transforms/DialectConversion.h
Commit 971f4173f82da6e13ee4c5b1a0301ba0fde0d696 by Mirko.Brkusanin
[AMDGPU][GlobalISel] Insert an and with exec before s_cbranch_vccnz if necessary

While v_cmp will AND inactive lanes with 0, that is not the case for logical
operations.

This fixes a Vulkan CTS test that would hang otherwise.

Differential Revision: https://reviews.llvm.org/D105709
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-brcond.mir
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
Commit d510b5f199d6e7a3062b5a6ea43181c4cc00a605 by david.spickett
[lldb][AArch64] Annotate synchronous tag faults

In the latest Linux kernels synchronous tag faults
include the tag bits in their address.
This change adds logical and allocation tags to the
description of synchronous tag faults.
(asynchronous faults have no address)

Process 1626 stopped
* thread #1, name = 'a.out', stop reason = signal SIGSEGV: sync tag check fault (fault address: 0x900fffff7ff9010 logical tag: 0x9 allocation tag: 0x0)

This extends the existing description and will
show as much as it can on the rare occasion something
fails.

This change supports AArch64 MTE only but other
architectures could be added by extending the
switch at the start of AnnotateSyncTagCheckFault.
The rest of the function is generic code.

Tests have been added for synchronous and asynchronous
MTE faults.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D105178
The file was modifiedlldb/source/Plugins/Process/Linux/NativeThreadLinux.h
The file was addedlldb/test/API/linux/aarch64/mte_tag_faults/Makefile
The file was addedlldb/test/API/linux/aarch64/mte_tag_faults/main.c
The file was addedlldb/test/API/linux/aarch64/mte_tag_faults/TestAArch64LinuxMTEMemoryTagFaults.py
The file was modifiedlldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
Commit d8fd2146daaa28d118fd7c29d63e817a8c955b81 by kbobyrev
NFC: Change quotes from Unicode to ASCII

This was causing some problems for Python scripts that we have.

Context: https://reviews.llvm.org/D106792
The file was modifiedclang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst
Commit da61ab847577dd81d6267c532d9810fc19596033 by Amara Emerson
[AArch64][GlobalISel] More widenToNextPow2 changes, this time for arithmetic/bitwise ops.
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-and.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
Commit 08d92dbbffa52db9b3fc3a871fb7feab6a0420c9 by cullen.rhodes
[AArch64][AsmParser] NFC: Parser.getTok() -> getTok()

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D106949
The file was modifiedllvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
Commit 8bf0a406087e8747383134847ab0f165e6475a97 by andrzej.warzynski
[flang][driver] Forward `-fopenmp`/`-fopenacc` to the host compiler

This patch only modifies `flang` - the bash wrapper script.

`-fopenmp`/`-fopenacc` are required to enable the OpenMP/OpenACC
extension in the frontend and to make sure that the required libraries
are linked when generating the final binary. This patch makes sure that
`-fopnemp`/`-fopenacc` is used for both unparsing and the code
generation (via the host compiler).

Differential Revision: https://reviews.llvm.org/D106871
The file was modifiedflang/tools/f18/flang.in
Commit b8f4232823d77c350ccf83cdd91b9f67fed2d31c by dvyukov
tsan: rename deadlock detector Mutex to UserMutex

It conflicts with sanitizer_common Mutex.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107053
The file was modifiedcompiler-rt/lib/tsan/dd/dd_rtl.h
Commit 4e15ee2867756f8676aa75d77cda8542cbd7498c by dvyukov
sanitizer_common: remove BlockingMutex and RWMutex

Remove the legacy typedefs and use Mutex/Lock types directly.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107043
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_symbolizer.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_mutex.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_libignore.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_libignore.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
The file was modifiedcompiler-rt/lib/tsan/dd/dd_rtl.cpp
The file was modifiedcompiler-rt/lib/tsan/dd/dd_rtl.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cpp
The file was modifiedcompiler-rt/lib/msan/msan_interceptors.cpp
The file was modifiedcompiler-rt/lib/hwasan/hwasan_report.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_addrhashmap.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_coverage_fuchsia.cpp
Commit 0d68cfc99668e56615a8bced8826feb4535efd13 by dvyukov
tsan: store ThreadRegistry in Context by value

It's unclear why we allocate ThreadRegistry separately,
I assume it's some historical leftover.
Embed ThreadRegistry into Context.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107045
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_debugging.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_mman.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
Commit 2537120c870c04893636f171f553024f378c2de8 by jeremy.morse
Follow-up to D105207, only salvage affine SCEVs to avoid a crash

SCEVToIterCountExpr only expects to be fed affine expressions, but
DbgRewriteSalvageableDVIs is feeding it non-affine induction variables.
Following this up with an obvious fix, will add test coverage too if
this avoids D105207 being reverted.
The file was modifiedllvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Commit 68546c9d6fc54a7ca7ad487cd4b6a5dafea9b4f3 by aaron
bugprone-forwarding-reference-overload: support non-type template parameters

Many concepts emulation libraries, such as the one found in Range v3, tend to
use non-type template parameters for the enable_if type expression, due to
their versatility in template functions and constructors containing variadic
template parameter packs.

Unfortunately the bugprone-forwarding-reference-overload check does not
handle non-type template parameters, as was first noted in this bug report:
https://bugs.llvm.org/show_bug.cgi?id=38081

This patch fixes this long standing issue and allows for the check to be suppressed
with the use of a non-type template parameter containing enable_if or enable_if_t in
the type expression, so long as it has a default literal value.
The file was modifiedclang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/bugprone-forwarding-reference-overload.cpp
The file was modifiedclang-tools-extra/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst
Commit 486489312743411ce2e25d7763e6d298f672f976 by sebastian.neubauer
[Utils] Do not remove comments in llc test script

When checking if two prefixes can be merged for a function,
update_llc_test_checks.py removed IR comments before comparing
llc outputs of different RUN lines.
This means, if one RUN line emited lines starting with ';' and another
RUN line emited the same lines except the ones starting with ';', both
RUNs would be merged (if they share a prefix).

However, CHECK-NEXT lines check the comments, otherwise they fail, so
the script should not merge RUNs if they contain different comments.

Differential Revision: https://reviews.llvm.org/D101312
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_no_merge_comments.ll
The file was modifiedllvm/utils/update_cc_test_checks.py
The file was modifiedllvm/utils/update_test_checks.py
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_no_merge_comments.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/amdgpu-no-merge-comments.test
The file was modifiedllvm/utils/update_llc_test_checks.py
The file was modifiedllvm/utils/update_analyze_test_checks.py
The file was modifiedllvm/utils/UpdateTestChecks/common.py