Changes

Summary

  1. [GuardWidening] Update test with update_test_checks.py (details)
  2. [GuardWidening] Add test showing incorrect behavior with nuw/nsw flags (details)
  3. [iwyu] Handle regressions in libLLVM header include (details)
  4. [GuardWidening] Remove nuw/nsw flags for hoisted instructions (details)
  5. Replace the custom linked list in LeaderTableEntry with TinyPtrVector. (details)
  6. [scudo] Link against libatomic on all MIPS targets (details)
  7. [MC] Lower case the first letter of EmitCOFF* EmitWin* EmitCV*. NFC (details)
  8. Update three tests to realpath paths that we compare to dyld paths (details)
  9. Defer source path remap tilde expansion until source file use (details)
  10. Revert "Defer source path remap tilde expansion until source file use" (details)
  11. [LV] Fix indentation in tryToCreateWidenRecipe (NFC). (details)
  12. [RISCV] Fix state persistence bugs (PR55548) (details)
  13. [SimpleLoopUnswitch] Always skip trivial select and set condition. (details)
  14. [libc++] Implement ranges::equal (details)
  15. [gn build] Port 569d6630204d (details)
  16. [RISCV][NFC] Add braces to 'else' to match braced 'if' (details)
  17. [AArch64] Costmodel tests for llvm.vscale intrinsics. NFC (details)
  18. [llvm][DWARF] Move test using X86 triple into X86 tests (details)
  19. [AArch64] Add additional tests for sinking free shuffles for FMAs. (details)
Commit 6f3f8b669b61898727cdc9799c227ad549a5a4ef by serguei.katkov
[GuardWidening] Update test with update_test_checks.py
The file was modifiedllvm/test/Transforms/GuardWidening/range-check-merging.ll
Commit 0a838ad517073e0c866a91661a0c2eb0ad0f77a8 by serguei.katkov
[GuardWidening] Add test showing incorrect behavior with nuw/nsw flags

when we move instruction over the guard we must clear nuw/nsw flags
but we do not.
The file was modifiedllvm/test/Transforms/GuardWidening/range-check-merging.ll
Commit fb67d683db46dfd88da09d99bd5a318b7cc81513 by sguelton
[iwyu] Handle regressions in libLLVM header include

Running iwyu-diff on LLVM codebase since 7030654296a0416bd9402a0278 detected a few
regressions, fixing them.

Differential Revision: https://reviews.llvm.org/D126417
The file was modifiedllvm/lib/Transforms/Coroutines/CoroFrame.cpp
The file was modifiedllvm/lib/Transforms/Coroutines/CoroCleanup.cpp
The file was modifiedllvm/lib/CodeGen/TypePromotion.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
The file was modifiedllvm/lib/CodeGen/GlobalISel/Utils.cpp
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
The file was modifiedllvm/lib/Analysis/ModelUnderTrainingRunner.cpp
The file was modifiedllvm/include/llvm/FuzzMutate/FuzzerCLI.h
The file was modifiedllvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
The file was modifiedllvm/lib/Support/BinaryStreamWriter.cpp
The file was modifiedllvm/lib/TableGen/Record.cpp
Commit c2eccc67ce07e9cb374eb0ecdb3038fcb8be08cd by serguei.katkov
[GuardWidening] Remove nuw/nsw flags for hoisted instructions

When we hoist instructions over guard we must clear flags due to these flags
might be implied using this guard, so they make sense only after the guard.

As an example of the bug due to current behavior.
L is known to be in range say [0, 100)
c1 = x u< L
guard (c1)
x1 = add x, 1
c2 = x1 u< L
guard(c2)

basing on guard(c1) we can say that x1 = add nuw nsw x, 1
after guard widening we get
c1 = x u< L
x1 = add nuw nsw x, 1
c2 = x1 u< L
c = and c1, c2
guard(c)

now, basing on fact that x + 1 < L and x >= 0 due to x + 1 is nuw
we can prove that x + 1 u< L implies that x u< L, so we can just remove c1
x1 = add nuw nsw x, 1
c2 = x1 u< L
guard(c2)

But that is not correct due to we will pass x == -1 value.

Reviewed By: mkazantsev
Subscribers: llvm-commits, nikic
Differential Revision: https://reviews.llvm.org/D126354
The file was modifiedllvm/test/Transforms/GuardWidening/range-check-merging.ll
The file was modifiedllvm/lib/Transforms/Scalar/GuardWidening.cpp
Commit 1e9114984490b83d4665f12a11f84c83f50ca8f0 by resistor
Replace the custom linked list in LeaderTableEntry with TinyPtrVector.

The purpose of the custom linked list was to optimize for the case
of a single-element list. It turns out that TinyPtrVector handles
the same basic scenario even better, reducing the size of
LeaderTableEntry by 33%, and requiring only log2(N) allocations
as the size of the list grows. The only downside is that we have
to store the Value's and BasicBlock's in separate vectors, which
is slightly awkward in a few cases. Fortunately that ends up being
entirely encapsulated inside helper functions.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D125205
The file was modifiedllvm/include/llvm/Transforms/Scalar/GVN.h
The file was modifiedllvm/lib/Transforms/Scalar/GVN.cpp
Commit a1ec3c5a8885d06f40859af6a310dbf32d479cdc by i
[scudo] Link against libatomic on all MIPS targets

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D126418
The file was modifiedcompiler-rt/lib/scudo/standalone/CMakeLists.txt
Commit 9ee15bba4744fb3b671428eec3cbec6a424dde07 by i
[MC] Lower case the first letter of EmitCOFF* EmitWin* EmitCV*. NFC
The file was modifiedllvm/lib/MC/MCCodeView.cpp
The file was modifiedllvm/lib/MC/MCParser/COFFAsmParser.cpp
The file was modifiedllvm/lib/Target/X86/X86AsmPrinter.cpp
The file was modifiedllvm/lib/Target/ARM/ARMAsmPrinter.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
The file was modifiedllvm/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp
The file was modifiedllvm/lib/Target/X86/X86MCInstLower.cpp
The file was modifiedllvm/lib/Object/RecordStreamer.h
The file was modifiedllvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
The file was modifiedllvm/unittests/CodeGen/AsmPrinterDwarfTest.cpp
The file was modifiedllvm/tools/llvm-mca/CodeRegionGenerator.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
The file was modifiedllvm/lib/MC/MCAsmStreamer.cpp
The file was modifiedllvm/include/llvm/MC/MCStreamer.h
The file was modifiedllvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
The file was modifiedllvm/unittests/CodeGen/TestAsmPrinter.h
The file was modifiedllvm/lib/MC/MCParser/MasmParser.cpp
The file was modifiedllvm/include/llvm/MC/MCWinCOFFStreamer.h
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
The file was modifiedllvm/lib/MC/MCParser/COFFMasmParser.cpp
The file was modifiedllvm/lib/MC/MCNullStreamer.cpp
The file was modifiedllvm/lib/MC/MCParser/AsmParser.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
The file was modifiedllvm/lib/MC/MCWinCOFFStreamer.cpp
The file was modifiedllvm/lib/MC/MCStreamer.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/WinException.cpp
Commit 8ee35c5558aa86e3be5f2882f1db030d6281578f by Jason Molenda
Update three tests to realpath paths that we compare to dyld paths

I get to my work directory through a symlink, so the pathnames the
tests get for their build artifacts etc are via that symlink.  There
are three tests which compare those symlink paths to a directory
received from dyld on macOS, which is the actual real pathname.

These tests have always failed for me on my dekstop but I finally
sat down to figure out why. Easy quick fix.
The file was modifiedlldb/test/API/commands/platform/sdk/TestPlatformSDK.py
The file was modifiedlldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
The file was modifiedlldb/test/API/macosx/function-starts/TestFunctionStarts.py
Commit c274b6e5830ea88d3f55d6dc1d2b99e38cf6595e by Jason Molenda
Defer source path remap tilde expansion until source file use

When reading source path remappings out of a dSYM, lldb currently
does tilde expansion -- expanding the tilde-username and checking
that the destination pathname exists, for each dSYM with the path
remappings.  This cost happens during lldb's initial process launch
/ load, an especially perf-sensitive time.  Inside Apple, we have
dSYMs with source path remappings pointing to NFS directories where
these extra stats for every dSYM can be very expensive if the network
is slow.

This patch instead keeps the source path mapping in the original
tilde-username terms and does the tilde expansion when we need
to read a specific source file from one of the modules.  We'll
be stat'ing all of those inodes to load the source file anyway,
so the fact that we do the tilde expansion on every source file
we load, it doesn't cost us significantly.

Differential Revision: https://reviews.llvm.org/D126435
rdar://77091379
The file was modifiedlldb/source/Core/SourceManager.cpp
The file was modifiedlldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
Commit 56ac85a20fb98393d033582ee4dc86993843726d by Jason Molenda
Revert "Defer source path remap tilde expansion until source file use"

This reverts commit c274b6e5830ea88d3f55d6dc1d2b99e38cf6595e.

The x86_64 debian bot got a failure with this patch,
https://lab.llvm.org/buildbot#builders/68/builds/33078
where
SymbolFile/DWARF/x86/DW_TAG_variable-DW_AT_decl_file-DW_AT_abstract_origin-crosscu1.s
is crashing here -

#2 0x0000000000425a9f SignalHandler(int) Signals.cpp:0:0
#3 0x00007f57160e9140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
#4 0x00007f570d911e43 lldb_private::SourceManager::GetFile(lldb_private::FileSpec const&) crtstuff.c:0:0
#5 0x00007f570d914270 lldb_private::SourceManager::DisplaySourceLinesWithLineNumbers(lldb_private::FileSpec const&, unsigned int, unsigned int, unsigned int, unsigned int, char const*, lldb_private::Stream*, lldb_private::SymbolContextList const*) crtstuff.c:0:0
#6 0x00007f570da662c8 lldb_private::StackFrame::GetStatus(lldb_private::Stream&, bool, bool, bool, char const*) crtstuff.c:0:0

I don't get a failure here my mac, I'll review this method more
closely tomorrow.
The file was modifiedlldb/source/Core/SourceManager.cpp
The file was modifiedlldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
Commit 390c0ac28db3557cad391b99ede20cd168c2dc30 by flo
[LV] Fix indentation in tryToCreateWidenRecipe (NFC).
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit e45087fd53d5946f47efa7bb7be088c668c386a1 by kito.cheng
[RISCV] Fix state persistence bugs (PR55548)

We didn't implement RISCVELFStreamer::reset and cause some very strange
section output for attribute section...just reference D15950 to see how
ARM implement that.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D125905
The file was modifiedllvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
The file was modifiedllvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
The file was modifiedllvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.h
The file was addedllvm/test/MC/RISCV/twice.ll
The file was modifiedllvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp
Commit f96aa493f0459d16a81e76c9d4f2915057cbcf7a by flo
[SimpleLoopUnswitch] Always skip trivial select and set condition.

When updating the branch instruction outside the loopduring non-trivial
unswitching, always skip trivial selects and update the condition.

Otherwise we might create invalid IR, because the trivial select is
inside the loop, while the condition is outside the loop.

Fixes #55697.
The file was modifiedllvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-trivial-select.ll
The file was modifiedllvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
Commit 569d6630204d5146aee7c0f40872cf529181d9ef by nikolasklauser
[libc++] Implement ranges::equal

Reviewed By: var-const, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D123681
The file was modifiedlibcxx/docs/Status/RangesAlgorithms.csv
The file was modifiedlibcxx/include/module.modulemap
The file was modifiedlibcxx/test/libcxx/algorithms/ranges_robust_against_copying_comparators.pass.cpp
The file was modifiedlibcxx/include/algorithm
The file was addedlibcxx/include/__algorithm/ranges_equal.h
The file was addedlibcxx/test/std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp
The file was modifiedlibcxx/include/CMakeLists.txt
The file was modifiedlibcxx/test/libcxx/algorithms/ranges_robust_against_copying_projections.pass.cpp
The file was modifiedlibcxx/test/libcxx/private_headers.verify.cpp
Commit 51f63589aec0a3960918bfad1146ebd20f213950 by llvmgnsyncbot
[gn build] Port 569d6630204d
The file was modifiedllvm/utils/gn/secondary/libcxx/include/BUILD.gn
Commit 2c9983f530512ce5be99b53c8cd895f1d2a3a04a by fraser
[RISCV][NFC] Add braces to 'else' to match braced 'if'
The file was modifiedllvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
Commit 75631438e333225bc8d738c901627a940b3232c3 by david.green
[AArch64] Costmodel tests for llvm.vscale intrinsics. NFC

These shows that the cost of a @llvm.vscale is indeed 1, not 10.
The file was addedllvm/test/Analysis/CostModel/AArch64/sve-vscale.ll
The file was addedllvm/test/Transforms/LoopVectorize/AArch64/sve-fneg.ll
Commit 38eb4fe74b3843ab0d7fc1eb95260caa8fbe96d7 by david.spickett
[llvm][DWARF] Move test using X86 triple into X86 tests

Fixes failure seen when building without X86 backend:
https://lab.llvm.org/buildbot/#/builders/171/builds/15124
The file was removedllvm/test/CodeGen/Generic/dwarf-aranges-zero-size.ll
The file was addedllvm/test/CodeGen/X86/dwarf-aranges-zero-size.ll
Commit a9a012086a917dff367bb63de2d63782b23111fc by flo
[AArch64] Add additional tests for sinking free shuffles for FMAs.
The file was modifiedllvm/test/Transforms/CodeGenPrepare/AArch64/sink-free-instructions.ll