Skip to content

Commit fec3144

Browse files
pratikasharigcbot
authored andcommitted
Treat spilled relocatable operands specially
When RA spills a variable that is known to always contain a compile time constant, we optimize the fill by reloading the constant using a mov rather than loading from memory. However, this optimization is illegal when constant being written in to spilled variable is a relocatable value. This change prevents spill/fill optimization for such relocatable operands.
1 parent 1d04cf5 commit fec3144

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

visa/SpillManagerGMRF.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,8 @@ static bool immFillCandidate(G4_INST *inst) {
800800
return inst->opcode() == G4_mov && inst->getExecSize() == g4::SIMD1 &&
801801
inst->getSrc(0)->isImm() && inst->isWriteEnableInst() &&
802802
inst->getDst()->getType() == inst->getSrc(0)->getType() &&
803-
!inst->getPredicate() && !inst->getCondMod() && !inst->getSaturate();
803+
!inst->getPredicate() && !inst->getCondMod() && !inst->getSaturate() &&
804+
!inst->getSrc(0)->isRelocImm();
804805
}
805806

806807
G4_SrcRegRegion *getSpillFillHeader(IR_Builder &builder, G4_Declare *decl);

0 commit comments

Comments
 (0)