-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Open
Description
I have the following IR, reduced from a much bigger test case (which would presumably also crash in a real program):
target datalayout = "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"
target triple = "avr"
declare ptr @bar() addrspace(1)
declare void @baz() addrspace(1)
define void @foo(ptr %arg) addrspace(1) {
entry:
%val = call addrspace(1) ptr @bar()
%gep1 = getelementptr { i8, i8, ptr }, ptr %val, i32 0, i32 1
%gep2 = getelementptr { i8, i8, ptr }, ptr %val, i32 0, i32 2
%gep3 = getelementptr { i8, i8, ptr }, ptr %arg, i32 0, i32 2
call addrspace(1) void @baz()
store i8 0, ptr %gep1, align 1
store ptr %gep2, ptr %arg, align 1
store ptr null, ptr %gep3, align 1
ret void
}
Compiling it, I get the following error:
$ llc -filetype=obj -o reduced.o reduced.ll
error: ran out of registers during register allocation
This happens with both LLVM 18.1.6 and with a recent LLVM build (4377656).
theoparis and jamesrwaugh