Skip to content

Commit 16311e1

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: 70aa3f3: Allow spills to spill again in fail safe iteration
Due to constraints, spilled variables may spill again in fail safe iteration. This generates extra code but it guarantees completion of compilation.
1 parent f6f28a7 commit 16311e1

File tree

4 files changed

+8
-22
lines changed

4 files changed

+8
-22
lines changed

visa/G4_Register.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,10 @@ class G4_RegVarTmp : public G4_RegVar {
393393

394394
public:
395395
G4_RegVarTmp(G4_Declare *d, G4_RegVar *base)
396-
: G4_RegVar(d, RegVarType::GRFSpillTmp), baseRegVar(base) {}
396+
: G4_RegVar(d, RegVarType::GRFSpillTmp), baseRegVar(base) {
397+
vASSERT(base->isRegVarTransient() == false);
398+
vASSERT(base == base->getBaseRegVar());
399+
}
397400
void *operator new(size_t sz, Mem_Manager &m) { return m.alloc(sz); }
398401

399402
G4_RegVar *getBaseRegVar() { return baseRegVar; }

visa/GraphColor.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6566,16 +6566,7 @@ void GraphColor::computeSpillCosts(bool useSplitLLRHeuristic, const RPE *rpe) {
65666566
lrs[i]->getVar()->isSpilled() == false) ||
65676567
dcl == gra.getOldFPDcl() ||
65686568
(!builder.canReadR0() && dcl == builder.getBuiltinR0())) {
6569-
if (failSafeIter) {
6570-
// Allow spills to again spill in fail safe iteration in order to
6571-
// guarantee compilation succeeds.
6572-
if (lrs[i]->getVar()->isRegVarTransient() == true ||
6573-
lrs[i]->getVar()->isRegVarTmp() == true) {
6574-
lrs[i]->setSpillCost(0.99f * MAXSPILLCOST);
6575-
} else
6576-
lrs[i]->setSpillCost(MAXSPILLCOST);
6577-
} else
6578-
lrs[i]->setSpillCost(MAXSPILLCOST);
6569+
lrs[i]->setSpillCost(MAXSPILLCOST);
65796570
} else if (dcl->isDoNotSpill()) {
65806571
lrs[i]->setSpillCost(MAXSPILLCOST);
65816572
}
@@ -6772,7 +6763,7 @@ void GraphColor::removeConstrained() {
67726763
void GraphColor::determineColorOrdering() {
67736764
numColor = 0;
67746765
if (liveAnalysis.livenessClass(G4_GRF))
6775-
numColor = totalGRFRegCount;
6766+
numColor = totalGRFRegCount - reserveSpillGRFCount;
67766767
else if (liveAnalysis.livenessClass(G4_ADDRESS))
67776768
numColor = builder.getNumAddrRegisters();
67786769
else if (liveAnalysis.livenessClass(G4_FLAG))
@@ -11210,7 +11201,6 @@ bool GlobalRA::setupFailSafeIfNeeded(bool fastCompile, bool hasStackCall,
1121011201
}
1121111202
}
1121211203
}
11213-
1121411204
return reserveSpillReg;
1121511205
}
1121611206

visa/RADebug.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,10 +1037,6 @@ bool Interference::dumpIntf(const char *s) const {
10371037
if (interfereBetween(i, j)) {
10381038
std::cout << "\t";
10391039
lrs[j]->getVar()->emit(std::cout);
1040-
if (lrs[j]->getPhyReg()) {
1041-
std::cout << "(r" << lrs[j]->getPhyReg()->asGreg()->getRegNum()
1042-
<< ")\n";
1043-
}
10441040
}
10451041
}
10461042
std::cout << "\n";

visa/SpillManagerGMRF.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,8 @@ bool SpillManagerGRF::shouldSpillRegister(G4_RegVar *regVar) const {
293293
: regVar;
294294
if (actualRegVar->getId() == UNDEFINED_VAL)
295295
return false;
296-
else if (regVar->isRegVarTransient() || regVar->isRegVarTmp()) {
297-
if (!failSafeSpill_)
298-
return false;
299-
return true;
300-
}
296+
else if (regVar->isRegVarTransient() || regVar->isRegVarTmp())
297+
return false;
301298
#ifndef ADDRESS_SENSITIVE_SPILLS_IMPLEMENTED
302299
else if (lvInfo_->isAddressSensitive(regVar->getId()))
303300
return false;

0 commit comments

Comments
 (0)