Skip to content

Commit 636218a

Browse files
committed
ngen: update PVC WAR bug workaround
1 parent a157fbe commit 636218a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

third_party/ngen/ngen_auto_swsb.hpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -1670,12 +1670,16 @@ PVCWARWA analyzePVCWARWA(HW hw, Program &program, BasicBlock &bb, int phase,
16701670
}
16711671

16721672
// Case 2: walk forward, looking for a new target send instruction.
1673+
auto eligibleSend = [=, &program](int inum) {
1674+
auto &insn = program[inum];
1675+
return (sendClass == getPipe(hw, insn).sendClassXeHPC()) && !insn.predicated();
1676+
};
1677+
16731678
if (adjust > 0) {
16741679
for (pww.inumSrc = dep.inum + 1; pww.inumSrc < inum; pww.inumSrc++) {
1675-
if (sendClass != getPipe(hw, program[pww.inumSrc]).sendClassXeHPC())
1676-
continue;
1680+
if (!eligibleSend(pww.inumSrc)) continue;
16771681
for (int srcN = 0; srcN <= 1; srcN++) {
1678-
auto &sr = bb.opRegions[dep.inum - bb.istart][srcN + 1];
1682+
auto &sr = bb.opRegions[pww.inumSrc - bb.istart][srcN + 1];
16791683
if (!sr.unspecified)
16801684
adjust -= sr.size;
16811685
}
@@ -1691,8 +1695,7 @@ PVCWARWA analyzePVCWARWA(HW hw, Program &program, BasicBlock &bb, int phase,
16911695
// Case 3: collect 2 GRFs worth of payload from this send class, walking backward.
16921696
int ngrf = 0;
16931697
for (int32_t iother = dep.inum; iother >= int32_t(bb.istart) && ngrf < 2; iother--) {
1694-
if (sendClass != getPipe(hw, program[iother]).sendClassXeHPC())
1695-
continue;
1698+
if (!eligibleSend(iother)) continue;
16961699
for (int srcN = 0; srcN <= 1; srcN++) {
16971700
auto &sr = bb.opRegions[iother - bb.istart][srcN + 1];
16981701
if (sr.unspecified) continue;

0 commit comments

Comments
 (0)