Skip to content

Commit 624621a

Browse files
authored
Mac optional (#2165)
1 parent 896da02 commit 624621a

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

Diff for: enzyme/Enzyme/JLInstSimplify.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,7 @@ bool jlInstSimplify(llvm::Function &F, TargetLibraryInfo &TLI,
108108
if (auto alias = arePointersGuaranteedNoAlias(
109109
TLI, AA, LI, I.getOperand(0), I.getOperand(1), false)) {
110110

111-
#if LLVM_VERSION_MAJOR >= 16
112-
bool val = alias.value();
113-
#else
114-
bool val = alias.getValue();
115-
#endif
111+
bool val = *alias;
116112
auto repval = ICmpInst::isTrueWhenEqual(pred)
117113
? ConstantInt::get(I.getType(), 1 - val)
118114
: ConstantInt::get(I.getType(), val);

Diff for: enzyme/Enzyme/Utils.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -2307,11 +2307,7 @@ bool overwritesToMemoryReadBy(const TypeResults *TR, llvm::AAResults &AA,
23072307
if (loadPtr && storePtr)
23082308
if (auto alias =
23092309
arePointersGuaranteedNoAlias(TLI, AA, LI, loadPtr, storePtr, true))
2310-
#if LLVM_VERSION_MAJOR >= 16
2311-
if (alias.value())
2312-
#else
2313-
if (alias.getValue())
2314-
#endif
2310+
if (*alias)
23152311
return false;
23162312

23172313
if (!overwritesToMemoryReadByLoop(SE, LI, DT, maybeReader, LoadBegin, LoadEnd,

0 commit comments

Comments
 (0)