Changes

Summary

  1. [Analysis] Fix another issue when querying vscale attributes on functions (details)
  2. [lldb] [Host] Refactor Socket::DecodeHostAndPort() to use LLVM API (details)
  3. [SystemZ] NFC: Remove unused intrinsic template arg 'name' (details)
  4. [compiler-rt] Use portable "#!/usr/bin/env bash" shebang for tests. (details)
  5. Revert "[DSE] Track earliest escape, use for loads in isReadClobber." (details)
  6. tsan: add a test for flushing memory (details)
  7. Revert "[JumpThreading] Ignore free instructions" (details)
  8. tsan: add a stress test (details)
  9. Revert "[InstCombine] fold cast of right-shift if high bits are not demanded (2nd try)" (details)
  10. [TargetLibraryInfo][AMDGPU] Minor cleanup, NFC (details)
  11. [llvm-objcopy][NFC] Add a helper method RelocationSectionBase::getNamePrefix() (details)
  12. [Transforms/Utils] Remove redundant declaration computeSyntheticCounts (NFC) (details)
  13. [libc++][NFC] Add missing link to a ranges review (details)
  14. [InstCombine] add tests for lshr-trunc-lshr; NFC (details)
  15. [x86] convert logic-of-FP-compares to FP logic-of-vector-compares (details)
  16. [libc++] Require a C++20 capable compiler. (details)
  17. [X86][SSE] combineMulToPMADDWD - replace sext(v8i16) -> zext(v8i16) (details)
  18. tsan: don't use pipe2 in tests (details)
  19. [MC][NFC] Add end-of-namespace comments (details)
Commit 8e4f7b749c2c03809f022c95698686c8584097fc by david.sherwood
[Analysis] Fix another issue when querying vscale attributes on functions

There are several places in the code that are currently broken where
we assume an Instruction is always a member of a BasicBlock that
lives in a Function. This is a problem specifically when
attempting to get the vscale_range attribute. This patch adds checks
that an Instruction's parent also has a parent!

I've added a test for a function-less @llvm.vscale intrinsic call here:

  unittests/Analysis/ValueTrackingTest.cpp
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp
The file was modifiedllvm/unittests/Analysis/ValueTrackingTest.cpp
Commit 5f1c8d8a432deacfeada5e5a3794d0c938171c37 by mgorny
[lldb] [Host] Refactor Socket::DecodeHostAndPort() to use LLVM API

Refactor Socket::DecodeHostAndPort() to use LLVM API over redundant
LLDB API.  In particular, this means llvm::Regex, llvm::Error return
type and llvm::to_integer().

While at it, change the port type from int32_t to uint16_t.  The method
never returns any value outside this range, and using the correct type
allows us to rely on getAsInteger()'s implicit overflow check.

Differential Revision: https://reviews.llvm.org/D110391
The file was modifiedlldb/source/Host/common/Socket.cpp
The file was modifiedlldb/source/Host/common/TCPSocket.cpp
The file was modifiedlldb/unittests/Host/SocketTest.cpp
The file was modifiedlldb/include/lldb/Host/Socket.h
The file was modifiedlldb/source/Host/common/UDPSocket.cpp
The file was modifiedlldb/tools/lldb-server/Acceptor.cpp
Commit ce21ab23b7555b44b6a6126a0b6bdce12af8736f by cullen.rhodes
[SystemZ] NFC: Remove unused intrinsic template arg 'name'

Identified in D109359.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D109598
The file was modifiedllvm/include/llvm/IR/IntrinsicsSystemZ.td
Commit 626e2a6c6236d2fd7582928a0363d381c55eb43d by shivam98.tkg
[compiler-rt] Use portable "#!/usr/bin/env bash" shebang for tests.

In build_symbolizer.sh we can safely remove the -eu argument from the shebang (which is an unportable construct), as the scripts sets **-e** and **-u** already.

Differential Revision: https://reviews.llvm.org/D110039
The file was modifiedcompiler-rt/lib/tsan/check_cmake.sh
The file was modifiedcompiler-rt/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh
The file was modifiedcompiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
The file was modifiedcompiler-rt/lib/gwp_asan/scripts/symbolize.sh
The file was modifiedcompiler-rt/lib/tsan/check_analyze.sh
The file was modifiedcompiler-rt/lib/asan/scripts/asan_device_setup
The file was modifiedcompiler-rt/lib/tsan/analyze_libtsan.sh
Commit df56fc6ebbee6c458b0473185277b7860f7e3408 by thakis
Revert "[DSE] Track earliest escape, use for loads in isReadClobber."

This reverts commit 5ce89279c0986d0bcbe526dce52f91dd0c16427c.
Makes clang crash, see comments on https://reviews.llvm.org/D109844
The file was modifiedllvm/include/llvm/Analysis/CaptureTracking.h
The file was modifiedllvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
The file was modifiedllvm/test/Transforms/DeadStoreElimination/captures-before-load.ll
The file was modifiedllvm/lib/Analysis/CaptureTracking.cpp
Commit ad890aa2327feb6b6aee676fe85b2352fba2403e by dvyukov
tsan: add a test for flushing memory

Add a test for __tsan_flush_memory() and for background
flushing of the runtime memory.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D110409
The file was modifiedcompiler-rt/include/sanitizer/tsan_interface.h
The file was addedcompiler-rt/test/tsan/flush_memory.cpp
Commit 4604695d7c20e72b551a1a5224f3de877cb41bd3 by hans
Revert "[JumpThreading] Ignore free instructions"

It caused compiler crashes, see comment on the code review for repro.

> This is basically D108837 but for jump threading. Free instructions
> should be ignored for the threading decision. JumpThreading already
> skips some free instructions (like pointer bitcasts), but does not
> skip various free intrinsics -- in fact, it currently gives them a
> fairly large cost of 2.
>
> Differential Revision: https://reviews.llvm.org/D110290

This reverts commit 1e3c6fc7cb9d2ee6a5328881f95d6643afeadbff.
The file was modifiedllvm/lib/Transforms/Scalar/JumpThreading.cpp
The file was modifiedllvm/test/Transforms/PhaseOrdering/inlining-alignment-assumptions.ll
The file was modifiedllvm/test/Transforms/JumpThreading/free_instructions.ll
The file was modifiedllvm/include/llvm/Transforms/Scalar/JumpThreading.h
Commit 124fcd7e9d2b8831dab0c50d4fce9900b033c6c2 by dvyukov
tsan: add a stress test

The stress test does various assorted things
(memory accesses, function calls, atomic operations,
thread creation/join, intercepted libc calls)
in multiple threads just to stress various parts
of the runtime.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D110416
The file was modifiedcompiler-rt/test/tsan/test.h
The file was addedcompiler-rt/test/tsan/stress.cpp
Commit 3c5500907b1089f4b274b09a195ee0685d51f9e2 by spatel
Revert "[InstCombine] fold cast of right-shift if high bits are not demanded (2nd try)"

This reverts commit bb9333c3504a4a02b982526ad8264d14c6ec1ad4.

This exposes another existing bug that causes an infinite loop as shown in
D110170
...so reverting while I look at another fix.
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
The file was modifiedllvm/test/Transforms/InstCombine/trunc-demand.ll
Commit 1376ae909431b78bee35899f301d1ab2f53cc1ba by paul.robinson
[TargetLibraryInfo][AMDGPU] Minor cleanup, NFC
The file was modifiedllvm/lib/Analysis/TargetLibraryInfo.cpp
Commit 6dda6c49ce4b67840c4f38d51111278b4b64c1bf by ikudrin
[llvm-objcopy][NFC] Add a helper method RelocationSectionBase::getNamePrefix()

Refactor handleArgs() to use that method.

Differential Revision: https://reviews.llvm.org/D110350
The file was modifiedllvm/tools/llvm-objcopy/ELF/Object.cpp
The file was modifiedllvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp
The file was modifiedllvm/tools/llvm-objcopy/ELF/Object.h
Commit c597594461bb3ba34a9699b744be09135635cbc7 by kazu
[Transforms/Utils] Remove redundant declaration computeSyntheticCounts (NFC)
The file was modifiedllvm/include/llvm/LTO/SummaryBasedOptimizations.h
The file was modifiedllvm/include/llvm/Transforms/Utils/FunctionImportUtils.h
Commit 1295694364d0698f991b458f2ea23f33a064db0a by Louis Dionne
[libc++][NFC] Add missing link to a ranges review
The file was modifiedlibcxx/docs/Status/RangesPaper.csv
Commit 638a4147fc6400b928080c6d5656fbcee707a793 by spatel
[InstCombine] add tests for lshr-trunc-lshr; NFC
The file was modifiedllvm/test/Transforms/InstCombine/lshr.ll
Commit 09e71c367af36a07cce04a812dcd9c62bebfbcdf by spatel
[x86] convert logic-of-FP-compares to FP logic-of-vector-compares

This is motivated by the examples and discussion in:
https://llvm.org/PR51245
...and related bugs.

By using vector compares and vector logic, we can convert 2 'set'
instructions into 1 'movd' or 'movmsk' and generally improve
throughput/reduce instructions.

Unfortunately, we don't have a complete vector compare ISA before
AVX, so I left SSE-only out of this patch. Ie, we'd need extra logic
ops to simulate the missing predicates for SSE 'cmpp*', so it's not
as clearly a win.

Differential Revision: https://reviews.llvm.org/D110342
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/lzcnt-zext-cmp.ll
The file was modifiedllvm/test/CodeGen/X86/fcmp-logic.ll
Commit f881776175e97f7667ad2d32cfea0ba6f4254181 by Louis Dionne
[libc++] Require a C++20 capable compiler.

This enforces libcxx and its benchmarks are compiled by a C++20 capable
compiler. Based on review comments in D103413.

Differential Revision: https://reviews.llvm.org/D110338
The file was modifiedlibcxx/CMakeLists.txt
The file was modifiedlibcxx/benchmarks/CMakeLists.txt
Commit d8fc9f87270146e271eddd551ea98580bef15e82 by llvm-dev
[X86][SSE] combineMulToPMADDWD - replace sext(v8i16) -> zext(v8i16)

As suggested on D108522, if we're sign extending a v4i16 source before multiplying as a v4i32, then we can replace that with a zero extension and rely on the implicit sign-extension of PMADDWD.
The file was modifiedllvm/test/CodeGen/X86/madd.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 34412cea5c247e30e49958213df10dd8f128d7e5 by dvyukov
tsan: don't use pipe2 in tests

MacOS buildbots failed:
stress.cpp:57:7: error: use of undeclared identifier 'pipe2'
https://green.lab.llvm.org/green//job/clang-stage1-RA/24209/consoleFull#-3468768778254eaf0-7326-4999-85b0-388101f2d404

Fix the test to not use pipe2.

Differential Revision: https://reviews.llvm.org/D110423
The file was modifiedcompiler-rt/test/tsan/stress.cpp
Commit e2546525902de18bb66a0c46ad3517d9f389fa47 by fraser
[MC][NFC] Add end-of-namespace comments
The file was modifiedllvm/include/llvm/MC/MCInstrDesc.h