File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
compiler/src/iree/compiler/Codegen/LLVMGPU Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,8 @@ struct SwapSetPrioWithMFMA : public OpRewritePattern<ROCDL::SetPrioOp> {
108108 return failure ();
109109 }
110110
111+ // Remove the swap attribute no matter what to avoid reapplying this
112+ // pattern.
111113 rewriter.startOpModification (setPrio);
112114 setPrio->removeDiscardableAttr (kSwapName );
113115
@@ -116,8 +118,6 @@ struct SwapSetPrioWithMFMA : public OpRewritePattern<ROCDL::SetPrioOp> {
116118
117119 for (int64_t remainingToSwap = count.getInt ();
118120 remainingToSwap > 0 && current; current = current->getNextNode ()) {
119- if (!current)
120- break ;
121121 if (isa<mlir::amdgpu::MFMAOp>(current)) {
122122 --remainingToSwap;
123123 mfmaToSwap = current;
@@ -126,6 +126,7 @@ struct SwapSetPrioWithMFMA : public OpRewritePattern<ROCDL::SetPrioOp> {
126126 if (mfmaToSwap) {
127127 rewriter.moveOpAfter (setPrio, mfmaToSwap);
128128 }
129+ rewriter.finalizeOpModification (setPrio);
129130 return success ();
130131 }
131132};
You can’t perform that action at this time.
0 commit comments