Skip to content

Commit 600c987

Browse files
committed
fix: add iteration count check
1 parent f70f8d3 commit 600c987

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/enzyme_ad/jax/Passes/EnzymeHLOOpt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23347,7 +23347,8 @@ struct RemoveNoOpsFromWhileLoop
2334723347
if (computeInfoSuccess.failed())
2334823348
return computeInfoSuccess;
2334923349

23350-
if (!info.isValid() || !info.isConstant())
23350+
if (!info.isValid() || !info.isConstant() ||
23351+
info.getConstantNumIters().value() <= 0)
2335123352
return failure();
2335223353

2335323354
auto &whileBody = whileOp.getBody().front();

0 commit comments

Comments
 (0)