diff --git a/src/enzyme_ad/jax/Passes/PolygeistMem2Reg.cpp b/src/enzyme_ad/jax/Passes/PolygeistMem2Reg.cpp index 1836bc15a2..19591eb251 100644 --- a/src/enzyme_ad/jax/Passes/PolygeistMem2Reg.cpp +++ b/src/enzyme_ad/jax/Passes/PolygeistMem2Reg.cpp @@ -1950,12 +1950,12 @@ bool isPromotable(mlir::Value AI) { } else if (isa(U)) { continue; } else if (auto callOp = dyn_cast(U)) { - if (StringAttr callee = - dyn_cast(callOp.getCallableForCallee()) - .getLeafReference()) - if (isCallNonCapturing(callOp, val) || - getNonCapturingFunctions().count(callee.str())) - continue; + if (auto sym = dyn_cast(callOp.getCallableForCallee())) { + if (StringAttr callee = sym.getLeafReference()) + if (isCallNonCapturing(callOp, val) || + getNonCapturingFunctions().count(callee.str())) + continue; + } } else if (auto CO = dyn_cast(U)) { list.push_back(CO); } else if (auto CO = dyn_cast(U)) {