opt: /root/llvm-project/llvm/lib/IR/Value.cpp:817: const llvm::Value* llvm::Value::stripAndAccumulateConstantOffsets(const llvm::DataLayout&, llvm::APInt&, bool, bool, llvm::function_ref<bool(llvm::Value&, llvm::APInt&)>, bool) const: Assertion `V->getType()->isPtrOrPtrVectorTy() && "Unexpected operand type!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=infer-alignment <source>
1. Running pass "function(infer-alignment)" on module "<source>"
2. Running pass "infer-alignment" on function "bitcast_b64_to_p1"
#0 0x0000000005ab3bb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5ab3bb8)
#1 0x0000000005ab09f4 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5ab09f4)
#2 0x0000000005ab0b6a SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x000076aee8045330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x000076aee809eb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
#5 0x000076aee804527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
#6 0x000076aee80288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
#7 0x000076aee802881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
#8 0x000076aee803b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#9 0x0000000005843f06 llvm::Value::stripAndAccumulateConstantOffsets(llvm::DataLayout const&, llvm::APInt&, bool, bool, llvm::function_ref<bool (llvm::Value&, llvm::APInt&)>, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5843f06)
#10 0x000000000478f013 inferAlignment(llvm::Function&, llvm::AssumptionCache&, llvm::DominatorTree&)::'lambda2'(llvm::Value*, llvm::Align, llvm::Align)::operator()(llvm::Value*, llvm::Align, llvm::Align) const (.isra.0) InferAlignment.cpp:0:0
#11 0x000000000478fc18 inferAlignment(llvm::Function&, llvm::AssumptionCache&, llvm::DominatorTree&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x478fc18)
#12 0x00000000047908dd llvm::InferAlignmentPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x47908dd)
#13 0x00000000030d9f2e llvm::detail::PassModel<llvm::Function, llvm::InferAlignmentPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x30d9f2e)
#14 0x0000000005817d17 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5817d17)
#15 0x0000000000f415ce llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0xf415ce)
#16 0x0000000005816886 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5816886)
#17 0x000000000098b85e llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x98b85e)
#18 0x0000000005815eb7 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5815eb7)
#19 0x0000000000995e69 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, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x995e69)
#20 0x000000000098963b optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x98963b)
#21 0x000076aee802a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#22 0x000076aee802a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#23 0x000000000097ef25 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x97ef25)
Program terminated with signal: SIGSEGV
Compiler returned: 139
Reproducer (see llvm/test/CodeGen/AMDGPU/GlobalISel/amdgpu-irtranslator.ll):
https://godbolt.org/z/qehMoqqq9
Backtrace: