Skip to content

Commit c70adaf

Browse files
authored
Fix upstream pred (#2230)
* Adapt to upstream * Fix upstream pred
1 parent bf11541 commit c70adaf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

enzyme/Enzyme/MustExitScalarEvolution.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,13 @@ ScalarEvolution::ExitLimit MustExitScalarEvolution::computeExitLimitFromICmp(
340340
const Loop *L, ICmpInst *ExitCond, bool ExitIfTrue, bool ControlsExit,
341341
bool AllowPredicates) {
342342
// If the condition was exit on true, convert the condition to exit on false
343-
auto Pred = (!ExitIfTrue) ? ExitCond->getPredicate()
344-
: ExitCond->getInversePredicate();
343+
#if LLVM_VERSION_MAJOR >= 20
344+
llvm::CmpPredicate Pred = ExitCond->getPredicate();
345+
#else
346+
auto Pred = ExitCond->getPredicate();
347+
#endif
348+
if (ExitIfTrue)
349+
Pred = ExitCond->getInversePredicate();
345350
const auto OriginalPred = Pred;
346351

347352
#if LLVM_VERSION_MAJOR < 14

0 commit comments

Comments
 (0)