Skip to content

Commit e6caa26

Browse files
DianaChensys_zuul
authored andcommitted
Fix the offset of spill/fill src address
Change-Id: I3275f9fa3499a0f11dca11207456d660ffa4b2e2
1 parent cb2cb14 commit e6caa26

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

visa/SpillManagerGMRF.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2613,14 +2613,15 @@ static G4_SrcRegRegion* getSpillFillHeader(IR_Builder& builder, G4_Declare* decl
26132613

26142614
// Create the send instruction to perform the spill of the spilled regvars's
26152615
// segment into spill memory.
2616-
2616+
// regOff - Offset of sub-spill. If one spill is splitted into more than one spill, this is the offset of them, unit in register size
2617+
// spillOff - Offset of the original variable being spilled, unit in register size.
26172618
G4_INST *
26182619
SpillManagerGRF::createSpillSendInstr (
26192620
G4_Declare * spillRangeDcl,
26202621
G4_Declare * mRangeDcl,
26212622
unsigned regOff,
26222623
unsigned height,
2623-
unsigned srcRegOff
2624+
unsigned spillOff
26242625
)
26252626
{
26262627
unsigned execSize (0);
@@ -2632,7 +2633,7 @@ SpillManagerGRF::createSpillSendInstr (
26322633
G4_RegVar* r = spillRangeDcl->getRegVar();
26332634
G4_RegVarTmp* rvar = static_cast<G4_RegVarTmp*> (r);
26342635
messageDescImm =
2635-
createSpillSendMsgDesc (srcRegOff, height, execSize, rvar->getBaseRegVar());
2636+
createSpillSendMsgDesc (spillOff, height, execSize, rvar->getBaseRegVar());
26362637
#ifdef _DEBUG
26372638
int offset = (messageDescImm->getInt() & 0xFFF) * GENX_GRF_REG_SIZ;
26382639
MUST_BE_TRUE(offset >= globalScratchOffset, "incorrect offset");
@@ -2665,7 +2666,7 @@ SpillManagerGRF::createSpillSendInstr (
26652666
int offset = getDisp(rvar->getBaseRegVar());
26662667
getSpillOffset(offset);
26672668
// message expects offsets to be in HWord
2668-
off = (offset + regOff * getGRFSize()) >> SCRATCH_SPACE_ADDRESS_UNIT;
2669+
off = (offset + spillOff * getGRFSize()) >> SCRATCH_SPACE_ADDRESS_UNIT;
26692670
fp = builder_->kernel.fg.getFramePtrDcl();
26702671
}
26712672
}
@@ -2925,14 +2926,14 @@ SpillManagerGRF::createFillInstr(
29252926

29262927
// Create the send instruction to perform the fill of the spilled regvars's
29272928
// segment from spill memory.
2928-
2929+
// spillOff - spill offset to the fillRangeDcl, in unit of grf size
29292930
G4_INST *
29302931
SpillManagerGRF::createFillSendInstr (
29312932
G4_Declare * fillRangeDcl,
29322933
G4_Declare * mRangeDcl,
29332934
unsigned regOff,
29342935
unsigned height,
2935-
unsigned srcRegOff
2936+
unsigned spillOff
29362937
)
29372938
{
29382939
unsigned execSize (0);
@@ -2944,7 +2945,7 @@ SpillManagerGRF::createFillSendInstr (
29442945
G4_RegVar* r = fillRangeDcl->getRegVar();
29452946
G4_RegVarTmp* rvar = static_cast<G4_RegVarTmp*> (r);
29462947
messageDescImm =
2947-
createFillSendMsgDesc (srcRegOff, height, execSize, rvar->getBaseRegVar());
2948+
createFillSendMsgDesc (spillOff, height, execSize, rvar->getBaseRegVar());
29482949
#ifdef _DEBUG
29492950
int offset = (messageDescImm->getInt() & 0xFFF) * GENX_GRF_REG_SIZ;
29502951
MUST_BE_TRUE(offset >= globalScratchOffset, "incorrect offset");
@@ -2976,7 +2977,7 @@ SpillManagerGRF::createFillSendInstr (
29762977
int offset = getDisp(rvar->getBaseRegVar());
29772978
getSpillOffset(offset);
29782979
// message expects offsets to be in HWord
2979-
off = (offset + regOff * getGRFSize()) >> SCRATCH_SPACE_ADDRESS_UNIT;
2980+
off = (offset + spillOff * getGRFSize()) >> SCRATCH_SPACE_ADDRESS_UNIT;
29802981
fp = builder_->kernel.fg.getFramePtrDcl();
29812982
}
29822983
}

visa/SpillManagerGMRF.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ class SpillManagerGRF
655655
G4_Declare * mRangeDcl,
656656
unsigned regOff,
657657
unsigned height,
658-
unsigned srcRegOff = 0
658+
unsigned spillOff
659659
);
660660

661661
G4_INST *
@@ -693,7 +693,7 @@ class SpillManagerGRF
693693
G4_Declare * mRangeDcl,
694694
unsigned regOff,
695695
unsigned height,
696-
unsigned srcRegOff = 0
696+
unsigned spillOff
697697
);
698698

699699
G4_INST *

0 commit comments

Comments
 (0)