diff --git a/enzyme/Enzyme/JLInstSimplify.cpp b/enzyme/Enzyme/JLInstSimplify.cpp index 3c369e8c7af..f0d29f0f856 100644 --- a/enzyme/Enzyme/JLInstSimplify.cpp +++ b/enzyme/Enzyme/JLInstSimplify.cpp @@ -108,10 +108,14 @@ bool jlInstSimplify(llvm::Function &F, TargetLibraryInfo &TLI, if (auto alias = arePointersGuaranteedNoAlias( TLI, AA, LI, I.getOperand(0), I.getOperand(1), false)) { - auto repval = - ICmpInst::isTrueWhenEqual(pred) - ? ConstantInt::get(I.getType(), 1 - alias.getValue()) - : ConstantInt::get(I.getType(), alias.getValue()); +#if LLVM_VERSION_MAJOR >= 16 + bool val = alias.value(); +#else + bool val = alias.getValue(); +#endif + auto repval = ICmpInst::isTrueWhenEqual(pred) + ? ConstantInt::get(I.getType(), 1 - val) + : ConstantInt::get(I.getType(), val); I.replaceAllUsesWith(repval); changed = true; continue; diff --git a/enzyme/Enzyme/Utils.cpp b/enzyme/Enzyme/Utils.cpp index 2cc7d68ddea..7ffbf7f0ea5 100644 --- a/enzyme/Enzyme/Utils.cpp +++ b/enzyme/Enzyme/Utils.cpp @@ -2307,7 +2307,11 @@ bool overwritesToMemoryReadBy(const TypeResults *TR, llvm::AAResults &AA, if (loadPtr && storePtr) if (auto alias = arePointersGuaranteedNoAlias(TLI, AA, LI, loadPtr, storePtr, true)) +#if LLVM_VERSION_MAJOR >= 16 + if (alias.value()) +#else if (alias.getValue()) +#endif return false; if (!overwritesToMemoryReadByLoop(SE, LI, DT, maybeReader, LoadBegin, LoadEnd,