SuccessChanges

Summary

  1. [libFuzzer] Fix stack overflow detection (details)
  2. [NFC][X86][MCA] AMD Zen3: add test for zero-cycle X87 move (details)
  3. [X86] AMD Zen 3: _REV variants of zero-cycles moves are also zero-cycles (PR50261) (details)
  4. [X86] combineXor - limit fold to non-opaque constants (PR50254) (details)
  5. [LoopNest] Consider loop nest with inner loop guard using outer loop (details)
  6. [libFuzzer] Fix stack-overflow-with-asan.test. (details)
  7. [AArch64][ELF] Prefer to lower MC_GlobalAddress operands to .Lfoo$local (details)
Commit 70cbc6dbef7048d3b1aa89a676d96c6ba075b41b by mascasa
[libFuzzer] Fix stack overflow detection

Address sanitizer can detect stack exhaustion via its SEGV handler, which is
executed on a separate stack using the sigaltstack mechanism. When libFuzzer is
used with address sanitizer, it installs its own signal handlers which defer to
those put in place by the sanitizer before performing additional actions. In the
particular case of a stack overflow, the current setup fails because libFuzzer
doesn't preserve the flag for executing the signal handler on a separate stack:
when we run out of stack space, the operating system can't run the SEGV handler,
so address sanitizer never reports the issue. See the included test for an
example.

This commit fixes the issue by making libFuzzer preserve the SA_ONSTACK flag
when installing its signal handlers; the dedicated signal-handler stack set up
by the sanitizer runtime appears to be large enough to support the additional
frames from the fuzzer.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D101824
The file was addedcompiler-rt/test/fuzzer/StackOverflowTest.cpp
The file was addedcompiler-rt/test/fuzzer/stack-overflow-with-asan.test
The file was modifiedcompiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
Commit a8e30e63aca0e9c61f956e61303ae3694cf00f2c by lebedev.ri
[NFC][X86][MCA] AMD Zen3: add test for zero-cycle X87 move
The file was addedllvm/test/tools/llvm-mca/X86/Znver3/reg-move-elimination-x87.s
Commit 2819009b5aa9725aebba63e8722e31943a7fb36f by lebedev.ri
[X86] AMD Zen 3: _REV variants of zero-cycles moves are also zero-cycles (PR50261)

Sometimes disassembler picks _REV variants of instructions
over the plain ones, which in this case exposed an issue
that the _REV variants aren't being modelled as optimizable moves.
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver3.td
The file was modifiedllvm/test/tools/llvm-mca/X86/Znver3/reg-move-elimination-avx-ymm.s
The file was modifiedllvm/test/tools/llvm-mca/X86/Znver3/reg-move-elimination-avx-xmm.s
Commit f744723f7538934e0beb5d8a2267afeb86345986 by llvm-dev
[X86] combineXor - limit fold to non-opaque constants (PR50254)

Ensure we don't try to fold when one might be an opaque constant - the constant fold will fail and then the reverse fold will happen in DAGCombine.....
The file was addedllvm/test/CodeGen/X86/pr50254.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 1006ac3963eaf39153d6637b631662e87ebf3b4d by whitneyt
[LoopNest] Consider loop nest with inner loop guard using outer loop
induction variable to be perfect

This patch allow more conditional branches to be considered as loop
guard, and so more loop nests can be considered perfect.

Reviewed By: bmahjour, sidbav

Differential Revision: https://reviews.llvm.org/D94717
The file was modifiedllvm/include/llvm/Analysis/LoopNestAnalysis.h
The file was modifiedllvm/lib/Analysis/LoopNestAnalysis.cpp
The file was modifiedllvm/unittests/Analysis/LoopInfoTest.cpp
The file was modifiedllvm/test/Analysis/LoopNestAnalysis/perfectnest.ll
The file was modifiedllvm/lib/Analysis/LoopInfo.cpp
The file was modifiedllvm/test/Analysis/LoopNestAnalysis/imperfectnest.ll
Commit f09414499c4717b66baa9581c641e8a636e5dcc1 by mascasa
[libFuzzer] Fix stack-overflow-with-asan.test.

Fix function return type and remove check for SUMMARY, since it doesn't
seem to be output in Windows.
The file was modifiedcompiler-rt/test/fuzzer/StackOverflowTest.cpp
The file was modifiedcompiler-rt/test/fuzzer/stack-overflow-with-asan.test
Commit 6a2850f3fc24cc53da6543ee98bd837007c65725 by i
[AArch64][ELF] Prefer to lower MC_GlobalAddress operands to .Lfoo$local

Similar to X86 D73230 & 46788a21f9152be3950e57dc526454655682bdd4

With this change, we can set dso_local in clang's -fpic -fno-semantic-interposition mode,
for default visibility external linkage non-ifunc-non-COMDAT definitions.

For such dso_local definitions, variable access/taking the address of a
function/calling a function will go through a local alias to avoid GOT/PLT.

Note: the 'S' inline assembly constraint refers to an absolute symbolic address
or a label reference (D46745).

Differential Revision: https://reviews.llvm.org/D101872
The file was modifiedllvm/lib/Target/AArch64/AArch64MCInstLower.cpp
The file was modifiedllvm/test/CodeGen/AArch64/elf-globals-static.ll
The file was addedllvm/test/CodeGen/AArch64/semantic-interposition-asm.ll
The file was modifiedllvm/test/CodeGen/AArch64/basic-pic.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
The file was addedllvm/test/CodeGen/AArch64/elf-preemption.ll