diff --git a/enzyme/Enzyme/GradientUtils.cpp b/enzyme/Enzyme/GradientUtils.cpp index c169365371a..57dc3951038 100644 --- a/enzyme/Enzyme/GradientUtils.cpp +++ b/enzyme/Enzyme/GradientUtils.cpp @@ -3822,6 +3822,9 @@ bool GradientUtils::legalRecompute(const Value *val, } } + if (isa(val)) + return false; + if (auto phi = dyn_cast(val)) { if (auto uiv = hasUninverted(val)) { if (auto dli = dyn_cast_or_null(uiv)) {