diff --git a/enzyme/Enzyme/MLIR/Implementations/SCFAutoDiffOpInterfaceImpl.cpp b/enzyme/Enzyme/MLIR/Implementations/SCFAutoDiffOpInterfaceImpl.cpp index 1bb32c817d3..4b5ef86100a 100644 --- a/enzyme/Enzyme/MLIR/Implementations/SCFAutoDiffOpInterfaceImpl.cpp +++ b/enzyme/Enzyme/MLIR/Implementations/SCFAutoDiffOpInterfaceImpl.cpp @@ -306,7 +306,7 @@ struct ForOpEnzymeOpsRemover auto newType = info.cachedType().cast().getShadowType( - numIters.value()); + numIters.value_or(ShapedType::kDynamic)); enzyme::InitOp newInit = ({ OpBuilder::InsertionGuard guard(builder); builder.setInsertionPoint(info.initOp);