[MachineVerifier] Undef subreg operands do not require subranges
D112556 added verification that the live interval for a subreg operand must have subranges. This patch fixes a corner case, where if all subreg operands for a particular register are undef uses then no subranges are required. This matches how LiveIntervalCalc would build the live intervals in the first place, since an undef use is not considered to read the register. Before this patch, CodeGen/AMDGPU/no-remat-indirect-mov.mir would fail with -early-live-intervals: # After Live Interval Analysis ... *** Bad machine code: Live interval for subreg operand has no subranges *** - function: index_vgpr_waterfall_loop - basic block: %bb.1 (0x6a9a968) [352B;496B) - instruction: 432B %24:vgpr_32 = V_MOV_B32_e32 undef %18.sub0:vreg_512, implicit $exec, implicit %18:vreg_512, implicit $m0 - operand 1: undef %18.sub0:vreg_512 Differential Revision: https://reviews.llvm.org/D115360
This commit is contained in:
parent
0ca00c3538
commit
cce93b3397
|
@ -2229,8 +2229,8 @@ void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) {
|
|||
if (LiveInts && Reg.isVirtual()) {
|
||||
if (LiveInts->hasInterval(Reg)) {
|
||||
LI = &LiveInts->getInterval(Reg);
|
||||
if (SubRegIdx != 0 && !LI->empty() && !LI->hasSubRanges() &&
|
||||
MRI->shouldTrackSubRegLiveness(Reg))
|
||||
if (SubRegIdx != 0 && (MO->isDef() || !MO->isUndef()) && !LI->empty() &&
|
||||
!LI->hasSubRanges() && MRI->shouldTrackSubRegLiveness(Reg))
|
||||
report("Live interval for subreg operand has no subranges", MO, MONum);
|
||||
} else {
|
||||
report("Virtual register has no live interval", MO, MONum);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
||||
# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -start-after=phi-node-elimination -stop-before=greedy -o - %s | FileCheck -check-prefix=GFX9 %s
|
||||
# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -start-after=phi-node-elimination -stop-before=greedy -early-live-intervals -o - %s | FileCheck -check-prefix=GFX9 %s
|
||||
|
||||
# Make sure that the V_MOV_B32 isn't rematerialized out of the loop. This was also breaking RenameIndependentSubregisters which missed the use of all subregisters.
|
||||
|
||||
|
|
Loading…
Reference in New Issue