[llvm] [aarch64][win] Add support for import call optimization (equivalent to MSVC /d2ImportCallOptimization) (PR #121516)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 12 12:52:31 PST 2025
fhahn wrote:
It looks like the change introduced a use-after-poison https://lab.llvm.org/buildbot/#/builders/169/builds/7294/steps/10/logs/stdio
```
FAIL: LLVM :: CodeGen/AArch64/machine-outliner-throw.ll (1 of 88242)
******************** TEST 'LLVM :: CodeGen/AArch64/machine-outliner-throw.ll' FAILED ********************
Exit Code: 2
Command Output (stderr):
--
RUN: at line 1: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64 < /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/AArch64/machine-outliner-throw.ll | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/AArch64/machine-outliner-throw.ll
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/AArch64/machine-outliner-throw.ll
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64
RUN: at line 2: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64 -stop-after=machine-outliner < /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/AArch64/machine-outliner-throw.ll | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/AArch64/machine-outliner-throw.ll -check-prefix=TARGET_FEATURES
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/AArch64/machine-outliner-throw.ll -check-prefix=TARGET_FEATURES
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64 -stop-after=machine-outliner
=================================================================
==1112042==ERROR: AddressSanitizer: use-after-poison on address 0x52100002dc30 at pc 0x5979d93c2be3 bp 0x7ffd78825d90 sp 0x7ffd78825d88
READ of size 8 at 0x52100002dc30 thread T0
#0 0x5979d93c2be2 in getParent /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:347:55
#1 0x5979d93c2be2 in llvm::MIRPrinter::convertCalledGlobals(llvm::yaml::MachineFunction&, llvm::MachineFunction const&, llvm::MachineModuleSlotTracker&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MIRPrinter.cpp:609:25
#2 0x5979d93b74ab in llvm::MIRPrinter::print(llvm::MachineFunction const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MIRPrinter.cpp:275:3
#3 0x5979d93cd392 in llvm::printMIR(llvm::raw_ostream&, llvm::MachineModuleInfo const&, llvm::MachineFunction const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MIRPrinter.cpp:1071:11
#4 0x5979d9417ede in (anonymous namespace)::MIRPrintingPass::runOnMachineFunction(llvm::MachineFunction&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MIRPrintingPass.cpp:65:5
#5 0x5979d8fdef61 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:94:13
#6 0x5979d9e9e183 in llvm::FPPassManager::runOnFunction(llvm::Function&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1406:27
#7 0x5979d9eb523e in llvm::FPPassManager::runOnModule(llvm::Module&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1452:16
#8 0x5979d9e9fd7a in runOnModule /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1521:27
#9 0x5979d9e9fd7a in llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:539:44
#10 0x5979d408e2dc in compileModule(char**, llvm::LLVMContext&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:751:8
#11 0x5979d408882f in main /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:411:22
#12 0x7cb6a4a2a3b7 (/lib/x86_64-linux-gnu/libc.so.6+0x2a3b7) (BuildId: 5f3f024b472f38389da3a2f567b3d0eaa8835ca2)
#13 0x7cb6a4a2a47a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a47a) (BuildId: 5f3f024b472f38389da3a2f567b3d0eaa8835ca2)
#14 0x5979d3f9c0a4 in _start (/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llc+0xb4bf0a4)
0x52100002dc30 is located 2864 bytes inside of 4096-byte region [0x52100002d100,0x52100002e100)
allocated by thread T0 here:
#0 0x5979d407bd82 in operator new(unsigned long, std::align_val_t) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:98:3
#1 0x5979db8b4e3d in llvm::allocate_buffer(unsigned long, unsigned long) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/MemAlloc.cpp:16:10
#2 0x5979d4516e59 in Allocate /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/AllocatorBase.h:92:12
#3 0x5979d4516e59 in StartNewSlab /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:346:42
#4 0x5979d4516e59 in llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>::AllocateSlow(unsigned long, unsigned long, llvm::Align) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:202:5
#5 0x5979d8ff9ed8 in Allocate /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:216:12
#6 0x5979d8ff9ed8 in allocate<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096UL, 4096UL, 128UL> > /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/ArrayRecycler.h:130:38
#7 0x5979d8ff9ed8 in allocateOperandArray /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/CodeGen/MachineFunction.h:1117:28
#8 0x5979d8ff9ed8 in llvm::MachineInstr::MachineInstr(llvm::MachineFunction&, llvm::MCInstrDesc const&, llvm::DebugLoc, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineInstr.cpp:108:19
#9 0x5979d8fb74cc in llvm::MachineFunction::CreateMachineInstr(llvm::MCInstrDesc const&, llvm::DebugLoc, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunction.cpp:433:7
#10 0x5979d45d7a8c in llvm::BuildMI(llvm::MachineFunction&, llvm::MIMetadata const&, llvm::MCInstrDesc const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/CodeGen/MachineInstrBuilder.h:375:37
#11 0x5979db2175cd in llvm::InstrEmitter::EmitMachineNode(llvm::SDNode*, bool, bool, llvm::SmallDenseMap<llvm::SDValue, llvm::Register, 16u, llvm::DenseMapInfo<llvm::SDValue, void>, llvm::detail::DenseMapPair<llvm::SDValue, llvm::Register>>&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp:1060:29
#12 0x5979db25acab in EmitNode /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h:145:7
#13 0x5979db25acab in llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>&)::$_0::operator()(llvm::SDNode*, bool, bool, llvm::SmallDenseMap<llvm::SDValue, llvm::Register, 16u, llvm::DenseMapInfo<llvm::SDValue, void>, llvm::detail::DenseMapPair<llvm::SDValue, llvm::Register>>&) const /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp:874:13
#14 0x5979db2587c3 in llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp:965:9
#15 0x5979db494dbe in llvm::SelectionDAGISel::CodeGenAndEmitDAG() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1151:42
#16 0x5979db48d112 in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1898:7
#17 0x5979db4848d1 in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:615:3
#18 0x5979db47dd38 in llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:375:20
#19 0x5979d8fdef61 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:94:13
#20 0x5979d9e9e183 in llvm::FPPassManager::runOnFunction(llvm::Function&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1406:27
#21 0x5979d9eb523e in llvm::FPPassManager::runOnModule(llvm::Module&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1452:16
#22 0x5979d9e9fd7a in runOnModule /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1521:27
#23 0x5979d9e9fd7a in llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:539:44
#24 0x5979d408e2dc in compileModule(char**, llvm::LLVMContext&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:751:8
#25 0x5979d408882f in main /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:411:22
#26 0x7cb6a4a2a3b7 (/lib/x86_64-linux-gnu/libc.so.6+0x2a3b7) (BuildId: 5f3f024b472f38389da3a2f567b3d0eaa8835ca2)
#27 0x7cb6a4a2a47a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a47a) (BuildId: 5f3f024b472f38389da3a2f567b3d0eaa8835ca2)
#28 0x5979d3f9c0a4 in _start (/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llc+0xb4bf0a4)
SUMMARY: AddressSanitizer: use-after-poison /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:347:55 in getParent
Shadow bytes around the buggy address:
0x52100002d980: 00 00 00 00 00 00 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7
0x52100002da00: f7 00 00 00 00 00 00 00 00 f7 f7 f7 f7 f7 f7 f7
0x52100002da80: f7 f7 f7 f7 00 00 00 00 00 00 00 00 f7 f7 f7 f7
0x52100002db00: f7 f7 f7 f7 f7 f7 f7 00 00 00 00 00 00 00 00 f7
0x52100002db80: 00 00 00 00 00 00 00 00 00 f7 00 00 00 00 00 00
=>0x52100002dc00: 00 00 f7 f7 f7 f7[f7]f7 f7 f7 f7 f7 f7 00 00 00
0x52100002dc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 f7 00 00
0x52100002dd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x52100002dd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f7 00
0x52100002de00: 00 00 00 00 00 00 00 00 f7 f7 f7 f7 f7 f7 f7 f7
0x52100002de80: f7 f7 f7 00 00 00 00 00 00 00 00 f7 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==1112042==ABORTING
```
Please take a look and revert the change if it takes longer to fix.
https://github.com/llvm/llvm-project/pull/121516
More information about the llvm-commits
mailing list