Changes

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

Summary

  1. tsan: enable -msse4 when compiling tests (details)
  2. tsan: add a test for vector memory accesses (details)
  3. tsan: add a benchmark for vector memory accesses (details)
  4. tsan: fix Java heap block begin in reports (details)
  5. tsan: fix another potential deadlock in fork (details)
  6. [libc++] Fix constraints for string_view's iterator/sentinel constructor (details)
  7. [libc++] Avoid overload resolution in path comparison operators (details)
  8. [llvm] Use range-based for loops (NFC) (details)
  9. [NFC][clang-tools-extra] Inclusive language: replace master with main (details)
  10. Revert "[ThreadPool] Support returning futures with results." (details)
  11. tsan: new runtime (v3) (details)
  12. [CMake] Add new cmake option to control adding comments in GenDAGISel (details)
  13. [libc++] Fix ssize test that made an assumption about ptrdiff_t being 'long' (details)
  14. [LLDB] Provide target specific directories to libclang (details)
  15. [NFC][llvm] Inclusive language: replace master with main in dbg-call-site-spilled-arg.mir (details)
  16. [PowerPC] Prevent the optimizer from producing wide vector types in IR. (details)
  17. [MLIR] NFC. Rename MLIR CAPI ExecutionEngine target for consistency (details)
  18. [NFC][compiler-rt] Inclusive language: replace master/slave with primary/secondary (details)
  19. [clang-format] NFC update LLVM overall clang-formatted status (details)
  20. [NFC][llvm] Inclusive language: replace master in llvm docs (details)
Commit d841086ae62118408e4211685c3e2f5fff0021b5 by dvyukov
tsan: enable -msse4 when compiling tests

Vector SSE accesses make compiler emit __tsan_[unaligned_]read/write16 callbacks.
Make it possible to test these.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D114591
The file was modifiedcompiler-rt/test/tsan/CMakeLists.txt
Commit 5cac2b956bcf42495a2253443502fb73dbb43c3d by dvyukov
tsan: add a test for vector memory accesses

Add a basic test that checks races between vector/non-vector
read/write accesses of different sizes/offsets in different orders.
This gives coverage of __tsan_read/write16 callbacks.

Depends on D114591.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D114592
The file was addedcompiler-rt/test/tsan/vector_race.cpp
The file was modifiedcompiler-rt/test/tsan/test.h
Commit debac0ef37d865d3a61d9abacdd096a676f1819d by dvyukov
tsan: add a benchmark for vector memory accesses

Depends on D114592.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D114593
The file was modifiedcompiler-rt/test/tsan/bench_memory_access.cpp
Commit b584741d06ef01b7497d58776e225aa189528968 by dvyukov
tsan: fix Java heap block begin in reports

We currently use a wrong value for heap block
(only works for C++, but not for Java).
Use the correct value (we already computed it before, just forgot to use).

Depends on D114593.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D114595
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
The file was modifiedcompiler-rt/test/tsan/java_symbolization.cpp
Commit 976bb4724c04ef7570d49a0639bba270128bd72c by dvyukov
tsan: fix another potential deadlock in fork

Linux/fork_deadlock.cpp currently hangs in debug mode in the following stack.
Disable memory access handling in OnUserAlloc/Free around fork.

1  0x000000000042c54b in __sanitizer::internal_sched_yield () at sanitizer_linux.cpp:452
2  0x000000000042da15 in __sanitizer::StaticSpinMutex::LockSlow (this=0x57ef02 <__sanitizer::internal_allocator_cache_mu>) at sanitizer_mutex.cpp:24
3  0x0000000000423927 in __sanitizer::StaticSpinMutex::Lock (this=0x57ef02 <__sanitizer::internal_allocator_cache_mu>) at sanitizer_mutex.h:32
4  0x000000000042354c in __sanitizer::GenericScopedLock<__sanitizer::StaticSpinMutex>::GenericScopedLock (this=this@entry=0x7ffcabfca0b8, mu=0x1) at sanitizer_mutex.h:367
5  0x0000000000423653 in __sanitizer::RawInternalAlloc (size=size@entry=72, cache=cache@entry=0x0, alignment=8, alignment@entry=0) at sanitizer_allocator.cpp:52
6  0x00000000004235e9 in __sanitizer::InternalAlloc (size=size@entry=72, cache=0x1, cache@entry=0x0, alignment=4, alignment@entry=0) at sanitizer_allocator.cpp:86
7  0x000000000043aa15 in __sanitizer::SymbolizedStack::New (addr=4802655) at sanitizer_symbolizer.cpp:45
8  0x000000000043b353 in __sanitizer::Symbolizer::SymbolizePC (this=0x7f578b77a028, addr=4802655) at sanitizer_symbolizer_libcdep.cpp:90
9  0x0000000000439dbe in __sanitizer::(anonymous namespace)::StackTraceTextPrinter::ProcessAddressFrames (this=this@entry=0x7ffcabfca208, pc=4802655) at sanitizer_stacktrace_libcdep.cpp:36
10 0x0000000000439c89 in __sanitizer::StackTrace::PrintTo (this=this@entry=0x7ffcabfca2a0, output=output@entry=0x7ffcabfca260) at sanitizer_stacktrace_libcdep.cpp:109
11 0x0000000000439fe0 in __sanitizer::StackTrace::Print (this=0x18) at sanitizer_stacktrace_libcdep.cpp:132
12 0x0000000000495359 in __sanitizer::PrintMutexPC (pc=4802656) at tsan_rtl.cpp:774
13 0x000000000042e0e4 in __sanitizer::InternalDeadlockDetector::Lock (this=0x7f578b1ca740, type=type@entry=2, pc=pc@entry=4371612) at sanitizer_mutex.cpp:177
14 0x000000000042df65 in __sanitizer::CheckedMutex::LockImpl (this=<optimized out>, pc=4) at sanitizer_mutex.cpp:218
15 0x000000000042bc95 in __sanitizer::CheckedMutex::Lock (this=0x600001000000) at sanitizer_mutex.h:127
16 __sanitizer::Mutex::Lock (this=0x600001000000) at sanitizer_mutex.h:165
17 0x000000000042b49c in __sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock (this=this@entry=0x7ffcabfca370, mu=0x1) at sanitizer_mutex.h:367
18 0x000000000049504f in __tsan::TraceSwitch (thr=0x7f578b1ca980) at tsan_rtl.cpp:656
19 0x000000000049523e in __tsan_trace_switch () at tsan_rtl.cpp:683
20 0x0000000000499862 in __tsan::TraceAddEvent (thr=0x7f578b1ca980, fs=..., typ=__tsan::EventTypeMop, addr=4499472) at tsan_rtl.h:624
21 __tsan::MemoryAccessRange (thr=0x7f578b1ca980, pc=4499472, addr=135257110102784, size=size@entry=16, is_write=true) at tsan_rtl_access.cpp:563
22 0x000000000049853a in __tsan::MemoryRangeFreed (thr=thr@entry=0x7f578b1ca980, pc=pc@entry=4499472, addr=addr@entry=135257110102784, size=16) at tsan_rtl_access.cpp:487
23 0x000000000048f6bf in __tsan::OnUserFree (thr=thr@entry=0x7f578b1ca980, pc=pc@entry=4499472, p=p@entry=135257110102784, write=true) at tsan_mman.cpp:260
24 0x000000000048f61f in __tsan::user_free (thr=thr@entry=0x7f578b1ca980, pc=4499472, p=p@entry=0x7b0400004300, signal=true) at tsan_mman.cpp:213
25 0x000000000044a820 in __interceptor_free (p=0x7b0400004300) at tsan_interceptors_posix.cpp:708
26 0x00000000004ad599 in alloc_free_blocks () at fork_deadlock.cpp:25
27 __tsan_test_only_on_fork () at fork_deadlock.cpp:32
28 0x0000000000494870 in __tsan::ForkBefore (thr=0x7f578b1ca980, pc=pc@entry=4904437) at tsan_rtl.cpp:510
29 0x000000000046fcb4 in syscall_pre_fork (pc=1) at tsan_interceptors_posix.cpp:2577
30 0x000000000046fc9b in __sanitizer_syscall_pre_impl_fork () at sanitizer_common_syscalls.inc:3094
31 0x00000000004ad5f5 in myfork () at syscall.h:9
32 main () at fork_deadlock.cpp:46

Depends on D114595.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D114597
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.cpp
Commit 68e7e76a9be022427e572101cde4e00203c9af46 by joeloser93
[libc++] Fix constraints for string_view's iterator/sentinel constructor

The `string_view` constructor taking an iterator/sentinel uses concepts
instead of type traits like the Standard states. Using `same_as` instead
of `is_same_v` should be harmless. Prefer `std::is_same_v` instead which is
cheaper to compile. Replace `convertible_to` with `is_convertible_v` as
well.

This observation came up while working on
https://reviews.llvm.org/D113161

Differential Revision: https://reviews.llvm.org/D114561
The file was modifiedlibcxx/include/string_view
Commit 3e7452a812fa06c5eaae7d089891489222417e92 by joeloser93
[libc++] Avoid overload resolution in path comparison operators

Rework `std::filesystem::path::operator==` and friends to avoid overload
resolution and atomic constraint caching issues shown from
https://reviews.llvm.org/D113161.

Always call `__compare(string_view)` from the comparison operators which avoids
overload resolution.

Differential Revision: https://reviews.llvm.org/D114570
The file was modifiedlibcxx/include/filesystem
Commit bfd5dd1568430a6c1500ed400c4de6028f6a2f3d by kazu
[llvm] Use range-based for loops (NFC)
The file was modifiedllvm/lib/CodeGen/CriticalAntiDepBreaker.cpp
The file was modifiedllvm/lib/CodeGen/InlineSpiller.cpp
The file was modifiedllvm/lib/CodeGen/LiveRangeEdit.cpp
The file was modifiedllvm/lib/CodeGen/MachineSink.cpp
The file was modifiedllvm/lib/CodeGen/MachineInstr.cpp
The file was modifiedllvm/lib/CodeGen/DeadMachineInstructionElim.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/Utils.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
The file was modifiedllvm/lib/CodeGen/ScheduleDAGInstrs.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
The file was modifiedllvm/lib/CodeGen/LocalStackSlotAllocation.cpp
Commit c3dc6b081da6ba503e67d260033f81f61eb38ea3 by quinn.pham
[NFC][clang-tools-extra] Inclusive language: replace master with main

[NFC] As part of using inclusive language within the llvm project, this patch
replaces master with main in `SubModule2.h`.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D114100
The file was modifiedclang-tools-extra/test/modularize/SubModule2.h
Commit 71a7c55f0f021b04b9a7303d0cd391b9161cf303 by Daniel.McIntosh
Revert "[ThreadPool] Support returning futures with results."

This reverts commit 6149e57dc1313d32c85524f8009a1249e0b8f4d1.

The offending commit broke building with LLVM_ENABLE_THREADS=OFF.
The file was modifiedllvm/unittests/Support/ThreadPool.cpp
The file was modifiedllvm/include/llvm/Support/ThreadPool.h
The file was modifiedllvm/lib/Support/ThreadPool.cpp
Commit 66d4ce7e26a5ab00f7e4946b6e1bac8f805010fa by dvyukov
tsan: new runtime (v3)

This change switches tsan to the new runtime which features:
- 2x smaller shadow memory (2x of app memory)
- faster fully vectorized race detection
- small fixed-size vector clocks (512b)
- fast vectorized vector clock operations
- unlimited number of alive threads/goroutimes

Depends on D112602.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112603
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_mman.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
The file was modifiedcompiler-rt/lib/tsan/tests/unit/tsan_sync_test.cpp
The file was modifiedcompiler-rt/lib/tsan/CMakeLists.txt
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.cpp
The file was modifiedcompiler-rt/lib/tsan/tests/unit/tsan_shadow_test.cpp
The file was modifiedcompiler-rt/test/tsan/bench_threads.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
The file was modifiedcompiler-rt/lib/tsan/go/buildgo.sh
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_mman.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_access.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_mutexset.h
The file was modifiedcompiler-rt/lib/tsan/go/tsan_go.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
The file was modifiedcompiler-rt/test/tsan/mutexset7.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp
The file was modifiedcompiler-rt/lib/tsan/check_analyze.sh
The file was modifiedcompiler-rt/lib/tsan/go/build.bat
The file was removedcompiler-rt/lib/tsan/rtl/tsan_update_shadow_word.inc
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_flags.inc
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interface_java.cpp
The file was modifiedcompiler-rt/lib/tsan/tests/unit/tsan_trace_test.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_defs.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_flags.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
The file was modifiedcompiler-rt/lib/tsan/tests/unit/tsan_stack_test.cpp
The file was modifiedcompiler-rt/lib/tsan/tests/unit/tsan_flags_test.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_platform_windows.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_shadow.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_trace.h
The file was modifiedcompiler-rt/test/tsan/memcpy_race.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_proc.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_sync.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_dense_alloc.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_platform.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_sync.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cpp
The file was modifiedcompiler-rt/test/tsan/free_race2.c
The file was modifiedcompiler-rt/test/tsan/memcmp_race.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_mutexset.cpp
Commit 1db1cb028db5f8af3a5bd5c264991791ae55f5f8 by lei
[CMake] Add new cmake option to control adding comments in GenDAGISel

Add new cmake option `LLVM_OMIT_DAGISEL_COMMENTS` to control adding
of comments in GenDAGISel for none debug builds

Ref: https://reviews.llvm.org/D78884

Reviewed By: nemanjai, MaskRay, #powerpc

Differential Revision: https://reviews.llvm.org/D114122
The file was modifiedllvm/cmake/modules/TableGen.cmake
The file was modifiedllvm/CMakeLists.txt
Commit 151a7dafd31683c8db933a6a03e305184e1218f9 by Louis Dionne
[libc++] Fix ssize test that made an assumption about ptrdiff_t being 'long'

On some platforms like armv7m, the size() method of containers returns
unsigned long, while ptrdiff_t is just int. Hence, std::ssize_t ends up
being long, which is not the same as ptrdiff_t. This is usually not an
issue because std::ptrdiff_t is long, so everything works out, but it
breaks on some more exotic architectures.

Differential Revision: https://reviews.llvm.org/D114563
The file was modifiedlibcxx/test/std/iterators/iterator.container/ssize.pass.cpp
Commit 1aab5e653d2cf8b147748d014c5fb513a4670418 by kosov.pavel
[LLDB] Provide target specific directories to libclang

On Linux some C++ and C include files reside in target specific directories, like /usr/include/x86_64-linux-gnu.
Patch adds them to libclang, so LLDB jitter has more chances to compile expression.

OS Laboratory. Huawei Russian Research Institute. Saint-Petersburg

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D110827
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.h
The file was modifiedlldb/unittests/Expression/CppModuleConfigurationTest.cpp
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp
Commit 34303d3db78fc62c74ff47557d07e4dac5c8c2d4 by quinn.pham
[NFC][llvm] Inclusive language: replace master with main in dbg-call-site-spilled-arg.mir

[NFC] As part of using inclusive language within the llvm project, this patch
replaces master with main in `dbg-call-site-spilled-arg.mir`.

Reviewed By: ZarkoCA

Differential Revision: https://reviews.llvm.org/D114097
The file was modifiedllvm/test/DebugInfo/MIR/X86/dbg-call-site-spilled-arg.mir
Commit 150681f2f3220ee6e00377cdcc0c97ee0abc63ba by amy.kwan1
[PowerPC] Prevent the optimizer from producing wide vector types in IR.

This patch prevents the optimizer from producing wide vectors in the IR,
specifically the MMA types (v256i1, v512i1). The idea is that on Power, we only
want to be producing these types only if the vector_pair and vector_quad types
are used specifically.

To prevent the optimizer from producing these types in the IR,
vectorCostAdjustmentFactor() is updated to return an instruction cost factor or
an invalid instruction cost if the current type is that of an MMA type. An
invalid instruction cost returned by this function signifies to other cost
computing functions to return the maximum instruction cost to inform the
optimizer that producing these types within the IR is expensive, and should not
be produced in the first place.

This issue was first seen in the test case included within this patch.

Differential Revision: https://reviews.llvm.org/D113900
The file was modifiedllvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
The file was addedllvm/test/Transforms/PGOProfile/ppc-prevent-mma-types.ll
Commit c89fc1eec3fd3cc358c7e350feb2f69ecaf0e63c by uday
[MLIR] NFC. Rename MLIR CAPI ExecutionEngine target for consistency

Rename MLIR CAPI ExecutionEngine target for consistency:
MLIRCEXECUTIONENGINE -> MLIRCAPIExecutionEngine in line with other
targets.

Differential Revision: https://reviews.llvm.org/D114596
The file was modifiedmlir/test/CAPI/CMakeLists.txt
The file was modifiedmlir/python/CMakeLists.txt
The file was modifiedmlir/lib/CAPI/ExecutionEngine/CMakeLists.txt
Commit 5c162ec54520114afd9ff0a53bcc5876747d4e94 by quinn.pham
[NFC][compiler-rt] Inclusive language: replace master/slave with primary/secondary

[NFC] As part of using inclusive language within the llvm project, this patch
replaces master and slave with primary and secondary respectively in
`sanitizer_mac.cpp`.

Reviewed By: ZarkoCA

Differential Revision: https://reviews.llvm.org/D114255
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
Commit 3c8666ef9a21e4646e428e4c8b5c6d4453042047 by mydeveloperday
[clang-format] NFC update LLVM overall clang-formatted status

Whilst the % clang-formatted remains the same, the number
of files added to the LLVM project has risen by almost by 259.

- 190 of them have been added clang-format clean.
- 69 files have been added unformatted. (lit tests should be excluded from this number)

- 291 files have been added to the list of files that are clang-format clean
- 101 files have either become unclean or have been removed

As this updates the clang-formatted-files there are now
8139 files that are clean which we can be used as a regression test when making changes to clang-format.

```
clang-format -verbose -n -files ./clang/docs/tools/clang-formatted-files.txt
```
The file was modifiedclang/docs/ClangFormattedStatus.rst
The file was modifiedclang/docs/tools/clang-formatted-files.txt
Commit a712b661eb94cd6f72abf024fe4b6d6e677cb1bd by quinn.pham
[NFC][llvm] Inclusive language: replace master in llvm docs

[NFC] As part of using inclusive language within the llvm project, this patch
removes instances of master in these files.

Reviewed By: ZarkoCA

Differential Revision: https://reviews.llvm.org/D114187
The file was modifiedllvm/docs/Projects.rst
The file was modifiedllvm/docs/PDB/index.rst
The file was modifiedllvm/docs/TableGen/ProgRef.rst