[PATCH] D40641: [SCEV] Fix wrong Equal predicate created in getAddRecForPhiWithCasts

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 22:38:59 PST 2017


sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.

lgtm with stylistic nits.



================
Comment at: lib/Analysis/ScalarEvolution.cpp:4631
     const SCEV *ExtendedExpr =
-        Signed ? getSignExtendExpr(TruncatedExpr, Expr->getType())
-               : getZeroExtendExpr(TruncatedExpr, Expr->getType());
+        isSigned ? getSignExtendExpr(TruncatedExpr, Expr->getType())
+                 : getZeroExtendExpr(TruncatedExpr, Expr->getType());
----------------
How about reducing the capture list of this lambda so that we don't have both `Signed` and `isSigned` in scope?

Alternately, you could s/`isSigned`/`CreateSignExtend`/ (actually now that I think of it, I like this option better than the first option).

Finally, the LLVM convention is to start variable names with uppercase.


https://reviews.llvm.org/D40641





More information about the llvm-commits mailing list