llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.29k stars 12.11k forks source link

Recent regression: Building libclc failed with `Invalid operands for select instruction!` #114009

Open sylvestre opened 4 weeks ago

sylvestre commented 4 weeks ago

on Linux Debian bookworm:


[846/2673] cd /build/source/libclc/build && /build/source/build-llvm/tools/clang/stage2-bins/bin/opt -O3 -o builtins.opt.tahiti-amdgcn--.bc /build/source/libclc/build/builtins.link.tahiti-amdgcn--.bc
FAILED: builtins.opt.tahiti-amdgcn--.bc /build/source/libclc/build/builtins.opt.tahiti-amdgcn--.bc
cd /build/source/libclc/build && /build/source/build-llvm/tools/clang/stage2-bins/bin/opt -O3 -o builtins.opt.tahiti-amdgcn--.bc /build/source/libclc/build/builtins.link.tahiti-amdgcn--.bc
Invalid operands for select instruction!
  %23 = select <3 x i1> %17, <4 x i32> <i32 0, i32 0, i32 0, i32 undef>, <4 x i32> %22
Invalid operands for select instruction!
  %23 = select <3 x i1> %17, <4 x i32> <i32 0, i32 0, i32 0, i32 undef>, <4 x i32> %22
Invalid operands for select instruction!
  %23 = select <3 x i1> %17, <4 x i32> <i32 0, i32 0, i32 0, i32 undef>, <4 x i32> %22
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.  Program arguments: /build/source/build-llvm/tools/clang/stage2-bins/bin/opt -O3 -o builtins.opt.tahiti-amdgcn--.bc /build/source/libclc/build/builtins.link.tahiti-amdgcn--.bc
1.  Running pass "verify" on module "/build/source/libclc/build/builtins.link.tahiti-amdgcn--.bc"
 #0 0x000003ff82c6d122 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:723:13
 #1 0x000003ff82c6d9b8 RunSignalHandlers build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Signals.cpp:106:18
 #2 0x000003ff82c6d9b8 SignalHandler(int) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:403:3
 #3 0x000002aa12a84d5e
 #4 0x000003ff8169872a (/lib/s390x-linux-gnu/libc.so.6+0x9872a)
 #5 0x000003ff816487a8 raise (/lib/s390x-linux-gnu/libc.so.6+0x487a8)
 #6 0x000003ff8162b5f4 abort (/lib/s390x-linux-gnu/libc.so.6+0x2b5f4)
 #7 0x000003ff82b88b02 llvm::report_fatal_error(llvm::Twine const&, bool) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/ErrorHandling.cpp:126:5
 #8 0x000003ff82b88936 (/build/source/build-llvm/tools/clang/stage2-bins/lib/libLLVM.so.20.0+0xf88936)
 #9 0x000003ff82ed3bb4 llvm::VerifierPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) build-llvm/tools/clang/stage2-bins/llvm/lib/IR/Verifier.cpp:0:5
#10 0x000003ff82e91678 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) build-llvm/tools/clang/stage2-bins/llvm/include/llvm/IR/PassManagerImpl.h:85:8
#11 0x000002aa11ea806c isSmall build-llvm/tools/clang/stage2-bins/llvm/include/llvm/ADT/SmallPtrSet.h:219:33
#12 0x000002aa11ea806c ~SmallPtrSetImplBase build-llvm/tools/clang/stage2-bins/llvm/include/llvm/ADT/SmallPtrSet.h:85:10
#13 0x000002aa11ea806c ~PreservedAnalyses build-llvm/tools/clang/stage2-bins/llvm/include/llvm/IR/Analysis.h:111:7
#14 0x000002aa11ea806c llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) build-llvm/tools/clang/stage2-bins/llvm/tools/opt/NewPMDriver.cpp:541:3
#15 0x000002aa11e9f17e _M_data /usr/lib/gcc/s390x-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:234:28
#16 0x000002aa11e9f17e _M_is_local /usr/lib/gcc/s390x-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:274:16
#17 0x000002aa11e9f17e _M_dispose /usr/lib/gcc/s390x-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:285:7
#18 0x000002aa11e9f17e ~basic_string /usr/lib/gcc/s390x-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:795:9
#19 0x000002aa11e9f17e optMain build-llvm/tools/clang/stage2-bins/llvm/tools/opt/optdriver.cpp:747:3
#20 0x000002aa11e9cb3a main build-llvm/tools/clang/stage2-bins/llvm/tools/opt/opt.cpp:0:42
#21 0x000003ff8162b89a (/lib/s390x-linux-gnu/libc.so.6+0x2b89a)
#22 0x000003ff8162b982 __libc_start_main (/lib/s390x-linux-gnu/libc.so.6+0x2b982)
#23 0x000002aa11e9ca40 _start (/build/source/build-llvm/tools/clang/stage2-bins/bin/opt+0x1ca40)
Aborted (core dumped)
sylvestre commented 4 weeks ago

On arm64:


FAILED: builtins.opt.cedar-r600--.bc /build/source/libclc/build/builtins.opt.cedar-r600--.bc 
cd /build/source/libclc/build && /build/source/build-llvm/tools/clang/stage2-bins/bin/opt -O3 -o builtins.opt.cedar-r600--.bc /build/source/libclc/build/builtins.link.cedar-r600--.bc
Invalid operands for select instruction!
  %32 = select <2 x i1> %29, <3 x float> <float -1.000000e+00, float -1.000000e+00, float poison>, <3 x float> %31
Invalid operands for select instruction!
  %33 = select <2 x i1> %30, <3 x float> <float 1.000000e+00, float 1.000000e+00, float poison>, <3 x float> %32
Invalid operands for select instruction!
  %28 = select <2 x i1> %26, <3 x i32> <i32 2139095040, i32 2139095040, i32 poison>, <3 x i32> %27
Invalid operands for select instruction!
  %28 = select <2 x i1> %26, <3 x i32> <i32 -8388608, i32 -8388608, i32 poison>, <3 x i32> %27
Invalid operands for select instruction!
  %25 = select <2 x i1> %23, <3 x i32> <i32 2139095040, i32 2139095040, i32 poison>, <3 x i32> %24
Invalid operands for select instruction!
  %20 = select <2 x i1> %18, <3 x i32> <i32 -2147483647, i32 -2147483647, i32 poison>, <3 x i32> %19
Invalid operands for select instruction!
  %32 = select <2 x i1> %29, <3 x float> <float -1.000000e+00, float -1.000000e+00, float poison>, <3 x float> %31
Invalid operands for select instruction!
  %33 = select <2 x i1> %30, <3 x float> <float 1.000000e+00, float 1.000000e+00, float poison>, <3 x float> %32
Invalid operands for select instruction!
  %28 = select <2 x i1> %26, <3 x i32> <i32 2139095040, i32 2139095040, i32 poison>, <3 x i32> %27
Invalid operands for select instruction!
  %28 = select <2 x i1> %26, <3 x i32> <i32 -8388608, i32 -8388608, i32 poison>, <3 x i32> %27
Invalid operands for select instruction!
  %25 = select <2 x i1> %23, <3 x i32> <i32 2139095040, i32 2139095040, i32 poison>, <3 x i32> %24
Invalid operands for select instruction!
  %21 = select <2 x i1> %18, <3 x float> <float 0xB6A0000000000000, float 0xB6A0000000000000, float poison>, <3 x float> %20
Invalid operands for select instruction!
  %69 = select <2 x i1> %66, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>, <3 x float> %67
Invalid operands for select instruction!
  %71 = select <2 x i1> %68, <3 x float> <float 0.000000e+00, float 0.000000e+00, float poison>, <3 x float> %69
Invalid operands for select instruction!
  %73 = select <2 x i1> %70, <3 x float> <float 0x400921FB60000000, float 0x400921FB60000000, float poison>, <3 x float> %71
Invalid operands for select instruction!
  %74 = select <2 x i1> %72, <3 x float> <float 0x3FF921FB60000000, float 0x3FF921FB60000000, float poison>, <3 x float> %73
Invalid operands for select instruction!
  %137 = select <2 x i1> %135, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>, <3 x float> %136
Invalid operands for select instruction!
  %72 = select <2 x i1> %69, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>, <3 x float> %70
Invalid operands for select instruction!
  %74 = select <2 x i1> %71, <3 x float> <float 0.000000e+00, float 0.000000e+00, float poison>, <3 x float> %72
Invalid operands for select instruction!
  %76 = select <2 x i1> %73, <3 x float> <float 1.000000e+00, float 1.000000e+00, float poison>, <3 x float> %74
Invalid operands for select instruction!
  %77 = select <2 x i1> %75, <3 x float> <float 5.000000e-01, float 5.000000e-01, float poison>, <3 x float> %76
Invalid operands for select instruction!
  %712 = select <2 x i1> %637, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>, <3 x float> %711
Invalid operands for select instruction!
  %84 = select <2 x i1> %81, <3 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float poison>, <3 x float> %82
Invalid operands for select instruction!
  %86 = select <2 x i1> %83, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>, <3 x float> %84
Invalid operands for select instruction!
  %87 = select <2 x i1> %85, <3 x float> <float 1.000000e+00, float 1.000000e+00, float poison>, <3 x float> %86
Invalid operands for select instruction!
  %113 = select <2 x i1> %100, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>, <3 x float> %112
Invalid operands for select instruction!
  %113 = select <2 x i1> %100, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>, <3 x float> %112
Invalid operands for select instruction!
  %23 = select <3 x i1> %17, <4 x i32> <i32 0, i32 0, i32 0, i32 undef>, <4 x i32> %22
Invalid operands for select instruction!
  %23 = select <3 x i1> %17, <4 x i32> <i32 0, i32 0, i32 0, i32 undef>, <4 x i32> %22
Invalid operands for select instruction!
  %23 = select <3 x i1> %17, <4 x i32> <i32 0, i32 0, i32 0, i32 undef>, <4 x i32> %22
Invalid operands for select instruction!
  %712 = select <2 x i1> %637, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>, <3 x float> %711
Invalid operands for select instruction!
  %84 = select <2 x i1> %80, <3 x float> %83, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>
Invalid operands for select instruction!
  %85 = select <2 x i1> %82, <3 x float> <float 0xFFF0000000000000, float 0xFFF0000000000000, float poison>, <3 x float> %84
Invalid operands for select instruction!
  %80 = select <2 x i1> %77, <3 x float> %78, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>
Invalid operands for select instruction!
  %81 = select <2 x i1> %79, <3 x float> <float 0xFFF0000000000000, float 0xFFF0000000000000, float poison>, <3 x float> %80
Invalid operands for select instruction!
  %85 = select <2 x i1> %82, <3 x float> %83, <3 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000, float poison>
Invalid operands for select instruction!
  %86 = select <2 x i1> %84, <3 x float> <float 0xFFF0000000000000, float 0xFFF0000000000000, float poison>, <3 x float> %85
Invalid operands for select instruction!
  %422 = select <2 x i1> %212, <3 x i32> <i32 1065353216, i32 1065353216, i32 poison>, <3 x i32> %421
Invalid operands for select instruction!
  %422 = select <2 x i1> %212, <3 x i32> <i32 1065353216, i32 1065353216, i32 poison>, <3 x i32> %421
Invalid operands for select instruction!
  %451 = select <2 x i1> %175, <3 x i32> <i32 2143289344, i32 2143289344, i32 poison>, <3 x i32> %450
Invalid operands for select instruction!
  %451 = select <2 x i1> %175, <3 x i32> <i32 2143289344, i32 2143289344, i32 poison>, <3 x i32> %450
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.  Program arguments: /build/source/build-llvm/tools/clang/stage2-bins/bin/opt -O3 -o builtins.opt.cedar-r600--.bc /build/source/libclc/build/builtins.link.cedar-r600--.bc
1.  Running pass "verify" on module "/build/source/libclc/build/builtins.link.cedar-r600--.bc"
 #0 0x0000ffff927588f4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:723:13
 #1 0x0000ffff92756b08 store /usr/lib/gcc/aarch64-linux-gnu/12/../../../../include/c++/12/atomic:271:2
 #2 0x0000ffff92756b08 llvm::sys::RunSignalHandlers() build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Signals.cpp:107:16
 #3 0x0000ffff92758ffc SignalHandler(int) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:0:3
 #4 0x0000ffff9961a5c0 (linux-vdso.so.1+0x5c0)
 #5 0x0000ffff913709f0 (/lib/aarch64-linux-gnu/libc.so.6+0x809f0)
 #6 0x0000ffff9132a72c raise (/lib/aarch64-linux-gnu/libc.so.6+0x3a72c)
 #7 0x0000ffff9131747c abort (/lib/aarch64-linux-gnu/libc.so.6+0x2747c)
 #8 0x0000ffff926ae7a4 llvm::report_fatal_error(llvm::Twine const&, bool) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/ErrorHandling.cpp:126:5
 #9 0x0000ffff926ae5e8 llvm::report_fatal_error(llvm::Twine const&, bool) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/ErrorHandling.cpp:91:0
#10 0x0000ffff9290e68c llvm::VerifierPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) build-llvm/tools/clang/stage2-bins/llvm/lib/IR/Verifier.cpp:7641:0
#11 0x0000ffff928debf0 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) build-llvm/tools/clang/stage2-bins/llvm/include/llvm/IR/PassManagerImpl.h:85:8
#12 0x0000aaaac9edb8a0 isSmall build-llvm/tools/clang/stage2-bins/llvm/include/llvm/ADT/SmallPtrSet.h:219:33
#13 0x0000aaaac9edb8a0 ~SmallPtrSetImplBase build-llvm/tools/clang/stage2-bins/llvm/include/llvm/ADT/SmallPtrSet.h:85:10
#14 0x0000aaaac9edb8a0 ~PreservedAnalyses build-llvm/tools/clang/stage2-bins/llvm/include/llvm/IR/Analysis.h:111:7
#15 0x0000aaaac9edb8a0 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) build-llvm/tools/clang/stage2-bins/llvm/tools/opt/NewPMDriver.cpp:541:3
#16 0x0000aaaac9ed1f10 optMain build-llvm/tools/clang/stage2-bins/llvm/tools/opt/optdriver.cpp:739:12
#17 0x0000ffff91317740 (/lib/aarch64-linux-gnu/libc.so.6+0x27740)
#18 0x0000ffff91317818 __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x27818)
#19 0x0000aaaac9ecc770 _start (/build/source/build-llvm/tools/clang/stage2-bins/bin/opt+0x18770)
Aborted (core dumped)
sylvestre commented 4 weeks ago

and same issue on amd64

sylvestre commented 4 weeks ago

regression range: 1df5c943439b..034cae42b130