mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-04 08:41:49 +00:00
MIR: Fix printer crashing on dead CSR frame indexes
llvm-svn: 361819
This commit is contained in:
parent
e0ee876b87
commit
c99e99c2e0
@ -403,6 +403,9 @@ void MIRPrinter::convertStackObjects(yaml::MachineFunction &YMF,
|
||||
}
|
||||
|
||||
for (const auto &CSInfo : MFI.getCalleeSavedInfo()) {
|
||||
if (!CSInfo.isSpilledToReg() && MFI.isDeadObjectIndex(CSInfo.getFrameIdx()))
|
||||
continue;
|
||||
|
||||
yaml::StringValue Reg;
|
||||
printRegMIR(CSInfo.getReg(), Reg, TRI);
|
||||
if (!CSInfo.isSpilledToReg()) {
|
||||
|
28
test/CodeGen/AMDGPU/mir-print-dead-csr-fi.mir
Normal file
28
test/CodeGen/AMDGPU/mir-print-dead-csr-fi.mir
Normal file
@ -0,0 +1,28 @@
|
||||
# RUN: llc -mtriple=amdgcn-amd-amdhsa -run-pass=prologepilog -o - %s | FileCheck %s
|
||||
|
||||
# Make sure the MIR printer doesn't crash when there are dead frame indexes. The
|
||||
# CSR SGPR frame indexes are inserted, but deleted.
|
||||
|
||||
# CHECK-LABEL: name: csr_sgpr
|
||||
# CHECK: fixedStack: []
|
||||
# CHECK: stack: []
|
||||
---
|
||||
name: csr_sgpr
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
- { reg: '$sgpr30_sgpr31' }
|
||||
frameInfo:
|
||||
maxAlignment: 4
|
||||
machineFunctionInfo:
|
||||
scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
|
||||
scratchWaveOffsetReg: '$sgpr4'
|
||||
frameOffsetReg: '$sgpr5'
|
||||
stackPtrOffsetReg: '$sgpr32'
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $sgpr30_sgpr31
|
||||
|
||||
INLINEASM &"; clobber s42", 1, 12, implicit-def dead early-clobber $sgpr42
|
||||
S_SETPC_B64_return $sgpr30_sgpr31
|
||||
|
||||
...
|
Loading…
x
Reference in New Issue
Block a user