Skip to content

[AVR] Ran out of registers during register allocationΒ #104032

@aykevl

Description

@aykevl

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions