Skip to content

[AArch64][SVE] Assertion fails in inserting sub vector of i1 #55405

@stevesuzuki-arm

Description

@stevesuzuki-arm

https://godbolt.org/z/hWMxo3PqW

define <vscale x 20 x i1> @concat_vector_i1(<vscale x 16 x i1> %a , <vscale x 4 x i1> %b) #0 {
    %1 = call <vscale x 20 x i1> @llvm.experimental.vector.insert.nxv20i1.nxv16i1(<vscale x 20 x i1> undef, <vscale x 16 x i1> %a, i64 0)
    %2 = call <vscale x 20 x i1> @llvm.experimental.vector.insert.nxv20i1.nxv4i1(<vscale x 20 x i1> %1,    <vscale x 4 x i1> %b, i64 16)
    ret <vscale x 20 x i1> %2
}

Crashes with target triple = "aarch64-linux-gnu" -mattr=+sve2 -O3

  unsigned EltSize = EltVT.getFixedSizeInBits() / 8; // FIXME: should be ABI size.
  assert(EltSize * 8 == EltVT.getFixedSizeInBits() &&
         "Converting bits to bytes lost precision");
llc: /root/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:8528: llvm::SDValue llvm::TargetLowering::getVectorSubVecPointer(llvm::SelectionDAG&, llvm::SDValue, llvm::EVT, llvm::EVT, llvm::SDValue) const: Assertion `EltSize * 8 == EltVT.getFixedSizeInBits() && "Converting bits to bytes lost precision"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mattr=+sve2 -O3 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'AArch64 Instruction Selection' on function '@concat_vector_i1'
 #0 0x000055df2efbbb6f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x000055df2efb95dc SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f29aee4a3c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
 #3 0x00007f29ae91703b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4303b)
 #4 0x00007f29ae8f6859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #5 0x00007f29ae8f6729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
 #6 0x00007f29ae908006 (/lib/x86_64-linux-gnu/libc.so.6+0x34006)
 #7 0x000055df2eddc312 llvm::TargetLowering::getVectorSubVecPointer(llvm::SelectionDAG&, llvm::SDValue, llvm::EVT, llvm::EVT, llvm::SDValue) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fdc312)
 #8 0x000055df2ee3025b llvm::DAGTypeLegalizer::SplitVecRes_INSERT_SUBVECTOR(llvm::SDNode*, llvm::SDValue&, llvm::SDValue&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x303025b)
 #9 0x000055df2ee60f53 llvm::DAGTypeLegalizer::SplitVectorResult(llvm::SDNode*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3060f53)
#10 0x000055df2ee1d732 llvm::DAGTypeLegalizer::run() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x301d732)
#11 0x000055df2ee1e8c6 llvm::SelectionDAG::LegalizeTypes() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x301e8c6)
#12 0x000055df2edb1a03 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fb1a03)
#13 0x000055df2edb54c3 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fb54c3)
#14 0x000055df2edb6bf8 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.962) SelectionDAGISel.cpp:0:0
#15 0x000055df2e2f98d6 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x24f98d6)
#16 0x000055df2e7aae16 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x29aae16)
#17 0x000055df2e7ab169 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x29ab169)
#18 0x000055df2e7abac9 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x29abac9)
#19 0x000055df2c94ea08 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#20 0x000055df2c8a9557 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xaa9557)
#21 0x00007f29ae8f80b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#22 0x000055df2c9453da _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xb453da)
Compiler returned: 139

Metadata

Metadata

Assignees

No one assigned

    Labels

    SVEARM Scalable Vector Extensionsbackend:AArch64crashPrefer [crash-on-valid] or [crash-on-invalid]llvm:SelectionDAGSelectionDAGISel as well

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions