Skip to content

[AArch64][GISel] Assert "invalid to directly change element size for pointers" #166556

@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 ptr> @_Z4testabbbyxiPA17_i(<4 x ptr> %0) {
entry:
  %1 = icmp ugt <4 x ptr> %0, zeroinitializer
  %2 = select <4 x i1> %1, <4 x ptr> %0, <4 x ptr> zeroinitializer
  ret <4 x ptr> %2
}

triggers this assert:

llc: /root/llvm-project/llvm/include/llvm/CodeGenTypes/LowLevelType.h:220: constexpr llvm::LLT llvm::LLT::changeElementSize(unsigned int) const: Assertion `!isPointerOrPointerVector() && "invalid to directly change element size for pointers"' 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 --verify-machineinstrs -global-isel <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'Legalizer' on function '@_Z4testabbbyxiPA17_i'
 #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 0x00007f75dfc42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007f75dfc969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007f75dfc42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007f75dfc287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007f75dfc2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007f75dfc39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x000000000482faf9 llvm::LegalizerHelper::lowerMinMax(llvm::MachineInstr&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x482faf9)
 #9 0x0000000004853c45 llvm::LegalizerHelper::lower(llvm::MachineInstr&, unsigned int, llvm::LLT) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4853c45)
#10 0x000000000480d7db 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+0x480d7db)

when compiled with llc -global-isel, see also: https://godbolt.org/z/663GxGane

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions