1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

MIR: Fix printer crashing on dead CSR frame indexes

llvm-svn: 361819
This commit is contained in:
Matt Arsenault 2019-05-28 13:08:31 +00:00
parent e0ee876b87
commit c99e99c2e0
2 changed files with 31 additions and 0 deletions

View File

@ -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()) {

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