Skip to content

Commit dc1e942

Browse files
bcheng0127igcbot
authored andcommitted
Fix bug of gather send
For mov imm optimiztion, failed to filter out the none-mov instruction
1 parent 110147b commit dc1e942

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

visa/Passes/SRSubstitution.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,10 @@ bool SRSubPassAfterRA::isSRCandidateAfterRA(G4_INST *inst,
617617
return (G4_INST *)nullptr;
618618
}
619619

620+
if (inst->opcode() != G4_mov) {
621+
return (G4_INST *)nullptr;
622+
}
623+
620624
G4_DstRegRegion *dst = inst->getDst();
621625
// dst GRF aligned and contigous
622626
if (dst->getSubRegOff() || dst->getHorzStride() != 1) {
@@ -687,7 +691,8 @@ bool SRSubPassAfterRA::isSRCandidateAfterRA(G4_INST *inst,
687691
movInstNum++;
688692
}
689693
} else {
690-
if (movInst->getSrc(0) && movInst->getSrc(0)->isImm()) {
694+
if (movInst->opcode() == G4_mov && movInst->getSrc(0) &&
695+
movInst->getSrc(0)->isImm()) {
691696
// Check if there is mov instruction with same imm value
692697
G4_INST *lvnMov = getRemoveableImm(movInst, immMovs);
693698

0 commit comments

Comments
 (0)