Skip to content

Commit c69b285

Browse files
committed
immediately erase
1 parent 86e961e commit c69b285

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/enzyme_ad/jax/Passes/EnzymeHLOOpt.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30305,8 +30305,10 @@ struct ReduceUnusedMultiSlice final
3030530305
return failure();
3030630306

3030730307
// If no results are used, this should be handled by dead code elimination
30308-
if (usedCount == 0)
30308+
if (usedCount == 0) {
30309+
rewriter.eraseOp(op);
3030930310
return failure();
30311+
}
3031030312

3031130313
// Find the range of used results
3031230314
int firstUsed = -1, lastUsed = -1;

0 commit comments

Comments
 (0)