Skip to content

Commit

Permalink
Treat spilled relocatable operands specially
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pratikashar authored and igcbot committed Jul 25, 2023
1 parent 8f4369f commit e0e7ff6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion visa/SpillManagerGMRF.h
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,8 @@ static bool immFillCandidate(G4_INST *inst) {
return inst->opcode() == G4_mov && inst->getExecSize() == g4::SIMD1 &&
inst->getSrc(0)->isImm() && inst->isWriteEnableInst() &&
inst->getDst()->getType() == inst->getSrc(0)->getType() &&
!inst->getPredicate() && !inst->getCondMod() && !inst->getSaturate();
!inst->getPredicate() && !inst->getCondMod() && !inst->getSaturate() &&
!inst->getSrc(0)->isRelocImm();
}

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

0 comments on commit e0e7ff6

Please sign in to comment.