-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Description
Reproducer: https://godbolt.org/z/ofx97TYjG
Testcase:
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
target triple = "aarch64-unknown-linux-musl"
define <2 x i8> @backsmith_pure_3() {
entry:
%0 = zext <2 x i1> zeroinitializer to <2 x i32>
%.neg44 = shl <2 x i32> splat (i32 1), %0
%.neg45 = trunc <2 x i32> %.neg44 to <2 x i8>
ret <2 x i8> %.neg45
}llc output:
llc: /root/llvm-project/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp:265: llvm::MachineInstrBuilder llvm::MachineIRBuilder::buildPadVectorWithUndefElements(const llvm::DstOp&, const llvm::SrcOp&): Assertion `(ResTy.getElementType() == Op0Ty.getElementType()) && "Different vector element types"' 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/llc -o /app/output.s -x86-asm-syntax=intel -O1 -global-isel <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'Legalizer' on function '@backsmith_pure_3'
#0 0x00000000041bbfc8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x41bbfc8)
#1 0x00000000041b8e74 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x000071d488c42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x000071d488c969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x000071d488c42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x000071d488c287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x000071d488c2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x000071d488c39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x00000000048a04e7 llvm::MachineIRBuilder::buildPadVectorWithUndefElements(llvm::DstOp const&, llvm::SrcOp const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x48a04e7)
#9 0x0000000004835a00 llvm::LegalizerHelper::moreElementsVectorSrc(llvm::MachineInstr&, llvm::LLT, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4835a00)
#10 0x000000000486a214 llvm::LegalizerHelper::moreElementsVector(llvm::MachineInstr&, unsigned int, llvm::LLT) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x486a214)
#11 0x000000000482bfbb llvm::Legalizer::legalizeMachineFunction(llvm::MachineFunction&, llvm::LegalizerInfo const&, llvm::ArrayRef<llvm::GISelChangeObserver*>, llvm::LostDebugLocObserver&, llvm::MachineIRBuilder&, llvm::GISelValueTracking*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x482bfbb)
#12 0x000000000482e38e llvm::Legalizer::runOnMachineFunction(llvm::MachineFunction&) (.part.0) Legalizer.cpp:0:0
#13 0x000000000309b2d9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#14 0x00000000036e8ff6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36e8ff6)
#15 0x00000000036e93a1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36e93a1)
#16 0x00000000036e9c0f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36e9c0f)
#17 0x00000000008fb51f compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#18 0x00000000007c85e9 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c85e9)
#19 0x000071d488c29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#20 0x000071d488c29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#21 0x00000000008f07b5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8f07b5)
Program terminated with signal: SIGSEGV
Compiler returned: 139