Skip to content

Commit 0f91265

Browse files
authored
Get MLIRContext from newOp, not the deleted load (#8373)
The `load` op is erased in `convertDistributedOpEncoding` so we should get the MLIR context from the `newOp` when setting op attributes. Interestingly, I found this issue only because the `loop-pipeline-hip.mlir` lit test crashed with bad access on my Mac laptop (ARM). On Linux/x86 the test runs fine w/ and w/out this fix.
1 parent 3910f27 commit 0f91265

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

third_party/amd/lib/TritonAMDGPUTransforms/ScheduleLoops.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static Operation *bypassLDS(Operation *load, Operation *use) {
300300

301301
// Finally, rewrite the load to use the inferred (better) encoding.
302302
auto newOp = convertDistributedOpEncoding(srcEnc, load);
303-
newOp->setAttr(AttrBypassLDS, BoolAttr::get(load->getContext(), true));
303+
newOp->setAttr(AttrBypassLDS, BoolAttr::get(newOp->getContext(), true));
304304
return newOp;
305305
};
306306

0 commit comments

Comments
 (0)