[PATCH] D13040: [SimplifyCFG] Constant fold a branch implied by it's incoming edge

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 17:55:31 PDT 2015


sanjoy added a comment.

I think it makes sense to put this in InstructionSimplify for now.  If it gets too large we can think of moving it into its own `LogicUtils.h` file.


================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2345
@@ +2344,3 @@
+
+  // i +_{nsw} C_{>0} <s L ==> i <s L
+  auto *ICmpA = dyn_cast<ICmpInst>(A);
----------------
Why not use matchers from PatternMatch.h here?  I think that will make the logic a lot more obvious.


http://reviews.llvm.org/D13040





More information about the llvm-commits mailing list