@@ -3165,7 +3165,7 @@ SpillManagerGRF::insertSpillRangeCode (
3165
3165
// offset to the spill range and create the instructions to load the
3166
3166
// save the spill range to spill memory.
3167
3167
3168
- if ((*spilledInstIter) ->mayExceedTwoGRF ())
3168
+ if (inst ->mayExceedTwoGRF ())
3169
3169
{
3170
3170
INST_LIST::iterator sendOutIter = spilledInstIter;
3171
3171
assert (getRFType (spilledRegion) == G4_GRF);
@@ -3175,13 +3175,19 @@ SpillManagerGRF::insertSpillRangeCode (
3175
3175
createAndInitMHeader (
3176
3176
(G4_RegVarTransient *) spillRangeDcl->getRegVar ());
3177
3177
3178
- sendInSpilledRegVarPortions (
3179
- spillRangeDcl, mRangeDcl , 0 ,
3180
- spillRangeDcl->getNumRows (),
3181
- spilledRegion->getRegOff ());
3178
+ // Assumption here is that a NoMask send doesn't need read-modify-write
3179
+ // since it writes the entire GRF(s).
3180
+ // May need to revisit if we have some strange sends that update partial GRFs. (e.g., SIMD4 scatter read)
3181
+ if (!inst->isWriteEnableInst ())
3182
+ {
3183
+ sendInSpilledRegVarPortions (
3184
+ spillRangeDcl, mRangeDcl , 0 ,
3185
+ spillRangeDcl->getNumRows (),
3186
+ spilledRegion->getRegOff ());
3182
3187
3183
- INST_LIST::iterator insertPos = sendOutIter;
3184
- bb->splice (insertPos, builder_->instList );
3188
+ INST_LIST::iterator insertPos = sendOutIter;
3189
+ bb->splice (insertPos, builder_->instList );
3190
+ }
3185
3191
3186
3192
sendOutSpilledRegVarPortions (
3187
3193
spillRangeDcl, mRangeDcl , 0 , spillRangeDcl->getNumRows (),
0 commit comments