llvm-project/llvm/test/CodeGen/AMDGPU/alloc-all-regs-reserved-in-class.mir
Matt Arsenault 1801e2aa24 RegAlloc: Fix assert if all registers in class reserved
With a context instruction, this would produce a context
error. However, it would continue on and do an out of bounds access of
the empty allocation order array.
2021-01-31 11:10:04 -05:00

19 lines
650 B
YAML

# RUN: not --crash llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=greedy -verify-machineinstrs -o /dev/null %s 2>&1 | FileCheck %s
# Check that there isn't an assert if we try to allocate a virtual register from
# a class where all registers are reserved. All AGPRs are reserved on subtargets
# that do not have them.
# CHECK-NOT: ran out of registers during register allocation
# CHECK: LLVM ERROR: no registers from class available to allocate
# CHECK-NOT: ran out of registers during register allocation
---
name: use_agpr
tracksRegLiveness: true
body: |
bb.0:
%0:agpr_32 = IMPLICIT_DEF
S_ENDPGM 0, implicit %0
...