Skip to content

[AArch64][GISel] buildPadVectorWithUndefElements: "Different vector element types" #166402

@sjoerdmeijer

Description

@sjoerdmeijer

This IR:

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-gnu"

define <4 x i8> @_Z4testjaashxhhihhhiPA12_jPA12_tPA12_A12_aPA12_A12_sPA12_S_PjPA12_A12_hPA12_A12_xS5_SH_PhPA20_hSB_PsPaSL_PySE_SA_PA12_A12_y() {
entry:
  %0 = zext <4 x i1> zeroinitializer to <4 x i32>
  %1 = shl <4 x i32> splat (i32 1), %0
  %2 = trunc <4 x i32> %1 to <4 x i8>
  ret <4 x i8> %2
}

triggers this assert:

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 -global-isel --verify-machineinstrs <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'Legalizer' on function '@_Z4testjaashxhhihhhiPA12_jPA12_tPA12_A12_aPA12_A12_sPA12_S_PjPA12_A12_hPA12_A12_xS5_SH_PhPA20_hSB_PsPaSL_PySE_SA_PA12_A12_y'
 #0 0x000000000419d348 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x419d348)
 #1 0x000000000419a1f4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x000078c495a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x000078c495a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x000078c495a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x000078c495a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x000078c495a2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x000078c495a39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000004881e77 llvm::MachineIRBuilder::buildPadVectorWithUndefElements(llvm::DstOp const&, llvm::SrcOp const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4881e77)
 #9 0x0000000004817220 llvm::LegalizerHelper::moreElementsVectorSrc(llvm::MachineInstr&, llvm::LLT, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4817220)
#10 0x000000000484bbc4 llvm::LegalizerHelper::moreElementsVector(llvm::MachineInstr&, unsigned int, llvm::LLT) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x484bbc4)

when compiled with llc -global-isel that has assertions enabled, see also:

https://godbolt.org/z/WjxYPdc8o

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions