Rewrite some code to not use a lambda function. The non-lambda code is just
about as clean as the original, and not any longer. The lambda function causes
an internal compiler error in GCC 4.8.0, and it is not worth breaking support
for that compiler over this. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245466
91177308-0d34-0410-b5e6-
96231b3b80d8
if (LAR->getStepRecurrence(SE) != RAR->getStepRecurrence(SE))
return false;
- auto CheckWrap = [Pred](const SCEVAddRecExpr *AR) -> bool {
- if (ICmpInst::isSigned(Pred))
- return AR->getNoWrapFlags(SCEV::FlagNSW);
- return AR->getNoWrapFlags(SCEV::FlagNUW);
- };
-
- if (!CheckWrap(LAR) || !CheckWrap(RAR))
+ SCEV::NoWrapFlags NW = ICmpInst::isSigned(Pred) ?
+ SCEV::FlagNSW : SCEV::FlagNUW;
+ if (!LAR->getNoWrapFlags(NW) || !RAR->getNoWrapFlags(NW))
return false;
return SE.isKnownPredicate(Pred, LAR->getStart(), RAR->getStart());