[AMDGPU] Prevent spills before exec mask is restored
Inline spiller can decide to move a spill as early as possible in the basic block. It will skip phis and label, but we also need to make sure it skips instructions in the basic block prologue which restore exec mask. Added isPositionLike callback in TargetInstrInfo to detect instructions which shall be skipped in addition to common phis, labels etc. Differential Revision: https://reviews.llvm.org/D27997 llvm-svn: 292554
This commit is contained in:
@@ -148,8 +148,11 @@ MachineBasicBlock::iterator MachineBasicBlock::getFirstNonPHI() {
|
||||
|
||||
MachineBasicBlock::iterator
|
||||
MachineBasicBlock::SkipPHIsAndLabels(MachineBasicBlock::iterator I) {
|
||||
const TargetInstrInfo *TII = getParent()->getSubtarget().getInstrInfo();
|
||||
|
||||
iterator E = end();
|
||||
while (I != E && (I->isPHI() || I->isPosition()))
|
||||
while (I != E && (I->isPHI() || I->isPosition() ||
|
||||
TII->isBasicBlockPrologue(*I)))
|
||||
++I;
|
||||
// FIXME: This needs to change if we wish to bundle labels
|
||||
// inside the bundle.
|
||||
@@ -160,8 +163,11 @@ MachineBasicBlock::SkipPHIsAndLabels(MachineBasicBlock::iterator I) {
|
||||
|
||||
MachineBasicBlock::iterator
|
||||
MachineBasicBlock::SkipPHIsLabelsAndDebug(MachineBasicBlock::iterator I) {
|
||||
const TargetInstrInfo *TII = getParent()->getSubtarget().getInstrInfo();
|
||||
|
||||
iterator E = end();
|
||||
while (I != E && (I->isPHI() || I->isPosition() || I->isDebugValue()))
|
||||
while (I != E && (I->isPHI() || I->isPosition() || I->isDebugValue() ||
|
||||
TII->isBasicBlockPrologue(*I)))
|
||||
++I;
|
||||
// FIXME: This needs to change if we wish to bundle labels / dbg_values
|
||||
// inside the bundle.
|
||||
|
||||
Reference in New Issue
Block a user