diff --git a/enzyme/Enzyme/EnzymeLogic.cpp b/enzyme/Enzyme/EnzymeLogic.cpp index 10dcebe48a5..d6707e0592e 100644 --- a/enzyme/Enzyme/EnzymeLogic.cpp +++ b/enzyme/Enzyme/EnzymeLogic.cpp @@ -270,7 +270,7 @@ struct CacheAnalysis { return false; } - if (hasMetadata(&li, "enzyme_force_recompute")) + if (hasNoCache(&li)) return false; if (EnzymeJuliaAddrLoad) diff --git a/enzyme/Enzyme/Utils.h b/enzyme/Enzyme/Utils.h index 636c0e41a50..95bb70bc78f 100644 --- a/enzyme/Enzyme/Utils.h +++ b/enzyme/Enzyme/Utils.h @@ -1181,6 +1181,9 @@ static inline bool hasNoCache(llvm::Value *op) { return true; } } + if (auto I = dyn_cast(op)) + if (hasMetadata(I, "enzyme_nocache")) + return true; return false; }