[PATCH] D129735: [RISCV] Add new pass to transform undef to pseudo for vector values.

Florian Mayer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 11:28:46 PST 2023


fmayer added a comment.

It seems like this breaks under ASan: https://lab.llvm.org/buildbot/#/builders/5/builds/31529/steps/13/logs/stdio

  FAIL: LLVM :: CodeGen/RISCV/regalloc-last-chance-recoloring-failure.ll (35389 of 72944)
  ******************** TEST 'LLVM :: CodeGen/RISCV/regalloc-last-chance-recoloring-failure.ll' FAILED ********************
  Script:
  --
  : 'RUN: at line 2';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/llc -mtriple=riscv64 -mattr=+f,+m,+zfh,+experimental-zvfh    -riscv-enable-subreg-liveness=false < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/RISCV/regalloc-last-chance-recoloring-failure.ll | /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/RISCV/regalloc-last-chance-recoloring-failure.ll
  : 'RUN: at line 4';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/llc -mtriple=riscv64 -mattr=+f,+m,+zfh,+experimental-zvfh < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/RISCV/regalloc-last-chance-recoloring-failure.ll    -riscv-enable-subreg-liveness=true| /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/RISCV/regalloc-last-chance-recoloring-failure.ll --check-prefix=SUBREGLIVENESS
  --
  Exit Code: 2
  Command Output (stderr):
  --
  =================================================================
  ==924420==ERROR: AddressSanitizer: use-after-poison on address 0x62100002da58 at pc 0x564ad06d209e bp 0x7ffe116375f0 sp 0x7ffe116375e8
  READ of size 8 at 0x62100002da58 thread T0
      #0 0x564ad06d209d in operands_begin /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:635:42
      #1 0x564ad06d209d in defs /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:679:23
      #2 0x564ad06d209d in isEarlyClobberMI /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp:175:26
      #3 0x564ad06d209d in processBasicBlock /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp:250:39
      #4 0x564ad06d209d in (anonymous namespace)::RISCVInitUndef::runOnMachineFunction(llvm::MachineFunction&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp:270:16
      #5 0x564ad2aa92d2 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:13
      #6 0x564ad39ba4a3 in llvm::FPPassManager::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1430:27
      #7 0x564ad39d4140 in llvm::FPPassManager::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1476:16
      #8 0x564ad39bc312 in runOnModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1545:27
      #9 0x564ad39bc312 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:44
      #10 0x564acd741a10 in compileModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:733:8
      #11 0x564acd741a10 in main /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:420:22
      #12 0x7f2985940d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
      #13 0x7f2985940e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
      #14 0x564acd66dba4 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/llc+0x7670ba4)
  0x62100002da58 is located 2392 bytes inside of 4096-byte region [0x62100002d100,0x62100002e100)
  allocated by thread T0 here:
      #0 0x564acd72db32 in operator new(unsigned long, std::align_val_t) /b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:107:3
      #1 0x564acdc2908d in Allocate /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/AllocatorBase.h:86:12
      #2 0x564acdc2908d in StartNewSlab /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:339:42
      #3 0x564acdc2908d in llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>::Allocate(unsigned long, llvm::Align) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:195:5
      #4 0x564ad2a81869 in Allocate /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:209:12
      #5 0x564ad2a81869 in operator new<llvm::MallocAllocator, 4096UL, 4096UL, 128UL> /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:443:20
      #6 0x564ad2a81869 in llvm::MachineFunction::init() /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunction.cpp:185:15
      #7 0x564ad2b43c17 in llvm::MachineModuleInfo::getOrCreateMachineFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineModuleInfo.cpp:108:14
      #8 0x564ad2aa8def in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:46:29
      #9 0x564ad39ba4a3 in llvm::FPPassManager::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1430:27
      #10 0x564ad39d4140 in llvm::FPPassManager::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1476:16
      #11 0x564ad39bc312 in runOnModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1545:27
      #12 0x564ad39bc312 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:44
      #13 0x564acd741a10 in compileModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:733:8
      #14 0x564acd741a10 in main /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:420:22
      #15 0x7f2985940d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
  SUMMARY: AddressSanitizer: use-after-poison /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:635:42 in operands_begin
  Shadow bytes around the buggy address:
    0x0c427fffdaf0: 00 f7 00 00 00 00 00 00 00 00 00 f7 00 00 00 00
    0x0c427fffdb00: 00 00 00 00 00 00 00 00 00 00 00 00 f7 00 00 00
    0x0c427fffdb10: 00 00 00 00 00 00 f7 00 00 00 00 00 00 00 00 00
    0x0c427fffdb20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x0c427fffdb30: 00 00 00 00 00 00 00 f7 00 00 00 00 00 00 00 00
  =>0x0c427fffdb40: 00 f7 00 00 00 00 f7 f7 f7 f7 f7[f7]f7 f7 f7 f7
    0x0c427fffdb50: f7 00 00 00 00 f7 00 00 00 00 00 00 00 00 00 f7
    0x0c427fffdb60: 00 00 00 00 00 00 00 00 f7 00 00 00 00 00 00 00
    0x0c427fffdb70: 00 00 f7 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x0c427fffdb80: 00 00 00 f7 00 00 00 00 00 00 00 00 00 f7 00 00
    0x0c427fffdb90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f7 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
  ==924420==ABORTING
  FileCheck error: '<stdin>' is empty.
  FileCheck command line:  /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/RISCV/regalloc-last-chance-recoloring-failure.ll --check-prefix=SUBREGLIVENESS
  --
  ********************
  Testing:  0.. 10.. 20.. 30.. 40..
  FAIL: LLVM :: CodeGen/RISCV/rvv/undef-earlyclobber-chain.ll (35659 of 72944)
  ******************** TEST 'LLVM :: CodeGen/RISCV/rvv/undef-earlyclobber-chain.ll' FAILED ********************
  Script:
  --
  : 'RUN: at line 2';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/llc -mtriple riscv64 -mattr=+v -riscv-enable-subreg-liveness < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/RISCV/rvv/undef-earlyclobber-chain.ll  | /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/RISCV/rvv/undef-earlyclobber-chain.ll
  --
  Exit Code: 2
  Command Output (stderr):
  --
  =================================================================
  ==928893==ERROR: AddressSanitizer: use-after-poison on address 0x62100005a980 at pc 0x55a20925a09e bp 0x7ffebd9ed930 sp 0x7ffebd9ed928
  READ of size 8 at 0x62100005a980 thread T0
      #0 0x55a20925a09d in operands_begin /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:635:42
      #1 0x55a20925a09d in defs /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:679:23
      #2 0x55a20925a09d in isEarlyClobberMI /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp:175:26
      #3 0x55a20925a09d in processBasicBlock /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp:250:39
      #4 0x55a20925a09d in (anonymous namespace)::RISCVInitUndef::runOnMachineFunction(llvm::MachineFunction&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp:270:16
      #5 0x55a20b6312d2 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:13
      #6 0x55a20c5424a3 in llvm::FPPassManager::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1430:27
      #7 0x55a20c55c140 in llvm::FPPassManager::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1476:16
      #8 0x55a20c544312 in runOnModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1545:27
      #9 0x55a20c544312 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:44
      #10 0x55a2062c9a10 in compileModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:733:8
      #11 0x55a2062c9a10 in main /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:420:22
      #12 0x7f2447396d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
      #13 0x7f2447396e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
      #14 0x55a2061f5ba4 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/llc+0x7670ba4)
  0x62100005a980 is located 2176 bytes inside of 4096-byte region [0x62100005a100,0x62100005b100)
  allocated by thread T0 here:
      #0 0x55a2062b5b32 in operator new(unsigned long, std::align_val_t) /b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:107:3
      #1 0x55a2067b108d in Allocate /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/AllocatorBase.h:86:12
      #2 0x55a2067b108d in StartNewSlab /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:339:42
      #3 0x55a2067b108d in llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>::Allocate(unsigned long, llvm::Align) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:195:5
      #4 0x55a20b609869 in Allocate /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:209:12
      #5 0x55a20b609869 in operator new<llvm::MallocAllocator, 4096UL, 4096UL, 128UL> /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Allocator.h:443:20
      #6 0x55a20b609869 in llvm::MachineFunction::init() /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunction.cpp:185:15
      #7 0x55a20b6cbc17 in llvm::MachineModuleInfo::getOrCreateMachineFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineModuleInfo.cpp:108:14
      #8 0x55a20b630def in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:46:29
      #9 0x55a20c5424a3 in llvm::FPPassManager::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1430:27
      #10 0x55a20c55c140 in llvm::FPPassManager::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1476:16
      #11 0x55a20c544312 in runOnModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1545:27
      #12 0x55a20c544312 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:44
      #13 0x55a2062c9a10 in compileModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:733:8
      #14 0x55a2062c9a10 in main /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:420:22
      #15 0x7f2447396d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
  SUMMARY: AddressSanitizer: use-after-poison /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:635:42 in operands_begin
  Shadow bytes around the buggy address:
    0x0c42800034e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x0c42800034f0: 00 f7 00 00 00 00 00 00 00 00 00 f7 00 00 00 00
    0x0c4280003500: f7 00 00 00 00 00 00 00 00 00 f7 00 00 00 00 00
    0x0c4280003510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x0c4280003520: 00 00 00 00 00 00 00 00 00 00 00 f7 f7 f7 f7 f7
  =>0x0c4280003530:[f7]f7 f7 f7 f7 f7 00 00 00 00 f7 00 00 00 00 00
    0x0c4280003540: 00 00 00 00 f7 00 00 00 00 00 00 00 00 00 00 00
    0x0c4280003550: 00 00 00 00 00 f7 00 00 00 00 00 00 00 00 00 f7
    0x0c4280003560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x0c4280003570: f7 00 00 00 00 00 00 00 00 00 f7 00 00 00 00 f7
    0x0c4280003580: 00 00 00 00 00 00 00 00 00 f7 00 00 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
  ==928893==ABORTING
  FileCheck error: '<stdin>' is empty.
  FileCheck command line:  /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/RISCV/rvv/undef-earlyclobber-chain.ll


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129735/new/

https://reviews.llvm.org/D129735



More information about the llvm-commits mailing list