[PATCH] D13390: SCEV: handle constant condition for select/branch

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 3 14:25:16 PDT 2015


sanjoy accepted this revision.

================
Comment at: lib/Analysis/ScalarEvolution.cpp:3894
@@ +3893,3 @@
+  if (!ICI) {
+    // If this is not an integer condition, it might still be a constant.
+    if (auto *CI = dyn_cast<ConstantInt>(Cond))
----------------
Minor stylistic issue, since you'll have to rebase anyway: instead of putting the check for `ConstantInt` inside the if block, I'd put it before the `dyn_cast<ICmpInst>`.  Shouldn't make any semantic difference, but it will reduce the nesting on `return getSCEV(CI->isOne() ? TrueVal : FalseVal);`.


http://reviews.llvm.org/D13390





More information about the llvm-commits mailing list