Changes

Summary

  1. tsan: add pragma line to buildgo.sh (details)
  2. [Attributor][NFC] Fix function name spelling (details)
  3. [OpenMP] Remove XFAIL and update check lines properly (details)
  4. [Attributor][NFCI] Expose `getAssumedUnderlyingObjects` API (details)
  5. [Attributor] Extend the AAValueSimplify compare simplification logic (details)
  6. [Attributor] Ensure to simplify operands in AAValueConstantRange (details)
  7. [Attributor] Gracefully handle interprocedural reachability queries (details)
  8. tsan: remove the stats subsystem (details)
  9. [lldb] Make WatchpointList iterable (details)
  10. [gn build] Port adb55d7c3265 (details)
  11. [RISCV] Add test cases to show an issue with our fcvt.wu isel patterns on RV64. (details)
  12. [NFC][profile] Move writeMMappedFile to ELF ifdef block (details)
  13. [PowerPC] Fallback to base's implementation of shouldExpandAtomicCmpXchgInIR and shouldExpandAtomicCmpXchgInIR (details)
  14. sanitizer_common: add new mutex (details)
  15. [Attributor] Use checkForAllUses instead of custom use tracking (details)
  16. [Attributor] Simplify to values in the genericValueTraversal (details)
  17. [Attributor] Use set vector instead of vector to prevent duplicates (details)
Commit d9b6e32dd74c63a12fb2872ca1b36479e4946a81 by dvyukov
tsan: add pragma line to buildgo.sh

Add pragma line so that errors messages point to the actual
source files rather than to the concatenated gotsan.cpp.

Reviewed By: vitalybuka, melver

Differential Revision: https://reviews.llvm.org/D106275
The file was modifiedcompiler-rt/lib/tsan/go/buildgo.sh
Commit 5e169818fb71d7baeb9d3dd92c747fbcd0bc8507 by johannes
[Attributor][NFC] Fix function name spelling
The file was modifiedllvm/include/llvm/Transforms/IPO/Attributor.h
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
Commit 205c520387ded946d22fd6c5ef1dd2d10aeaf294 by johannes
[OpenMP] Remove XFAIL and update check lines properly

Undo 15c5701c8324d2dea519fa379c04d5c619a570ab and update check lines.
The file was modifiedllvm/test/Transforms/OpenMP/custom_state_machines.ll
Commit 9c00aabd6090d4cb9c31342b6c7ce9bd00ae9558 by johannes
[Attributor][NFCI] Expose `getAssumedUnderlyingObjects` API
The file was modifiedllvm/include/llvm/Transforms/IPO/Attributor.h
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
Commit 5fbb51d8d58fef32a88c9d9d54f094db076c2c2a by johannes
[Attributor] Extend the AAValueSimplify compare simplification logic

We first simplify the operands of a compare and then reason on the
simplified versions, e.g., with AANonNull.

This does improve the simplification capabilities but also fixes a
potential problem that has not yet been observed by simplifying the
operands first.
The file was modifiedllvm/test/Transforms/Attributor/heap_to_stack.ll
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
The file was modifiedllvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
The file was modifiedllvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll
The file was modifiedllvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
The file was modifiedllvm/test/Transforms/Attributor/liveness.ll
The file was modifiedllvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll
The file was modifiedllvm/test/Transforms/Attributor/depgraph.ll
The file was modifiedllvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
The file was modifiedllvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll
The file was modifiedllvm/test/Transforms/Attributor/align.ll
The file was modifiedllvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll
The file was modifiedllvm/test/Transforms/Attributor/value-simplify.ll
The file was modifiedllvm/test/Transforms/Attributor/cgscc_bugs.ll
The file was modifiedllvm/test/Transforms/Attributor/memory_locations.ll
The file was modifiedllvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll
Commit b96ea6b1fd260f09a246b9d168ea166bb7a199d1 by johannes
[Attributor] Ensure to simplify operands in AAValueConstantRange

As with other patches before, the simplification callback interface
requires us to go through the Attributor::getAssumedSimplified API first
before we recurs.

It is unclear if the problem can be explicitly tested with our current
infrastructure.
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
Commit 49f2b41e6f9d5bea4d6803cc27bf667dd2bf4b63 by johannes
[Attributor] Gracefully handle interprocedural reachability queries

This does ensure `InformationCache::getPotentiallyReachable` will not
crash/assert on instructions from different functions but simply return
that one is reachable, which is conservatively correct.
The file was modifiedllvm/include/llvm/Transforms/IPO/Attributor.h
Commit adb55d7c326559e99f1eeb3234cdfaaf3c9010de by dvyukov
tsan: remove the stats subsystem

I don't think the stat subsystem was ever used since tsan
development in 2012. But it adds lots of code and this
effectively dead code needs to be updated if the runtime
code changes, which adds maintanance cost for no benefit.
Normal profiler usually gives enough info and that info
is more trustworthy.
Remove the stats subsystem.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D106276
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_mutex.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_mutex.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp
The file was modifiedcompiler-rt/lib/tsan/go/build.bat
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_clock.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cpp
The file was modifiedcompiler-rt/lib/tsan/CMakeLists.txt
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_defs.h
The file was modifiedcompiler-rt/lib/tsan/go/buildgo.sh
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interface_ann.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_trace.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_mman.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
The file was modifiedcompiler-rt/lib/tsan/tests/unit/tsan_mutex_test.cpp
The file was removedcompiler-rt/lib/tsan/rtl/tsan_stat.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.cpp
The file was removedcompiler-rt/lib/tsan/rtl/tsan_stat.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_sync.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_update_shadow_word_inl.h
Commit 7b54b1cdafbcaa5721bcf8ae78e8390a74d580bf by mgorny
[lldb] Make WatchpointList iterable

Based on de448c0a9e5088979526e2e67152fe547ae4ccf0.

Differential Revision: https://reviews.llvm.org/D106263
The file was modifiedlldb/include/lldb/Breakpoint/WatchpointList.h
The file was modifiedlldb/source/Target/Target.cpp
The file was modifiedlldb/source/Commands/CommandCompletions.cpp
Commit 53942cd4dcf6950736083a75bc4f97b7e7dd2ebf by llvmgnsyncbot
[gn build] Port adb55d7c3265
The file was modifiedllvm/utils/gn/secondary/compiler-rt/lib/tsan/BUILD.gn
Commit 4f1270a61e15fc43b8467885254f7246b4b75b71 by craig.topper
[RISCV] Add test cases to show an issue with our fcvt.wu isel patterns on RV64.

The pattern we match is (sext_inreg (assertzexti32 (fp_to_uint)), i32). If
the assertzexti32 has an additional user we'll end up emitting
an fcvt.wu and an fcvt.lu.

This can happen if the original fp_to_uint before type legalization
has one user that causes a sext_inreg to be emitted and one that
doesn't.
The file was modifiedllvm/test/CodeGen/RISCV/float-convert.ll
The file was modifiedllvm/test/CodeGen/RISCV/half-convert.ll
The file was modifiedllvm/test/CodeGen/RISCV/double-convert.ll
Commit ff427909caa6f1ec8392800087a90cc6a0664153 by phosek
[NFC][profile] Move writeMMappedFile to ELF ifdef block

This avoids the compiler warning on Darwin where that function is unused.
The file was modifiedcompiler-rt/lib/profile/InstrProfilingFile.c
Commit e2ee27b20b46b654decb575afc5ae8317a05ec3f by lkail
[PowerPC] Fallback to base's implementation of shouldExpandAtomicCmpXchgInIR and shouldExpandAtomicCmpXchgInIR

If we can't decide `shouldExpandAtomicCmpXchgInIR` or `shouldExpandAtomicCmpXchgInIR` in PPC's implementation after https://reviews.llvm.org/rGb9c3941cd61de1e1b9e4f3311ddfa92394475f4b, resort to base's implementation.

This fixes internal build of OpenMP which uses atomic operations on float.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D106234
The file was addedllvm/test/CodeGen/PowerPC/atomic-float.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.cpp
The file was addedllvm/test/Transforms/AtomicExpand/PowerPC/atomicrmw-fp.ll
Commit 3f981fc1861a0683eb00b442d4cad7410d4a8e59 by dvyukov
sanitizer_common: add new mutex

We currently have 3 different mutexes:
- RWMutex
- BlockingMutex
- __tsan::Mutex

RWMutex and __tsan::Mutex are roughly the same,
except that tsan version supports deadlock detection.
BlockingMutex degrades better under heavy contention
from lots of threads (blocks in OS), but much slower
for light contention and has non-portable performance
and has larger static size and is not reader-writer.

Add a new mutex that combines all advantages of these
mutexes: it's reader-writer, has fast non-contended path,
supports blocking to gracefully degrade under higher contention,
has portable size/performance.

For now it's named Mutex2 for incremental submission. The plan is to:
- land this change
- then move deadlock detection logic from tsan
- then rename it to Mutex and remove tsan Mutex
- then typedef RWMutex/BlockingMutex to this mutex

SpinMutex stays as separate type because it has faster fast path:
1 atomic RMW per lock/unlock as compared to 2 for this mutex.

Reviewed By: vitalybuka, melver

Differential Revision: https://reviews.llvm.org/D106231
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_mutex.h
The file was modifiedcompiler-rt/lib/sanitizer_common/tests/sanitizer_mutex_test.cpp
Commit 5eba7846a5cb3777bf1178da5bbd86f117157d98 by johannes
[Attributor] Use checkForAllUses instead of custom use tracking

AAMemoryBehaviorFloating used a custom use tracking mechanism even
though checkForAllUses exists and is already more powerful. Further,
AAMemoryBehaviorFloating uses AANoCapture to guarantee that there are no
aliases and following the uses is sufficient. This is an OK assumption
if checkForAllUses is used but custom tracking is easily out of sync
with AANoCapture and problems follow.
The file was modifiedllvm/test/Transforms/Attributor/heap_to_stack.ll
The file was modifiedllvm/test/Transforms/Attributor/depgraph.ll
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
Commit 5957cf9f11bf28591196730cb639e29a11e76abb by johannes
[Attributor] Simplify to values in the genericValueTraversal

We already simplified to a constant, given the new interface we can also
simplify to a generic value.
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
The file was modifiedllvm/test/Transforms/Attributor/readattrs.ll
The file was modifiedllvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll
The file was modifiedllvm/test/Transforms/Attributor/memory_locations.ll
Commit c66cbee140ce69fa17ffb6b8b03616beca30dca1 by johannes
[Attributor] Use set vector instead of vector to prevent duplicates
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp