[PATCH] D34762: [JumpThreading] Add a pattern to TryToUnfoldSelectInCurrBB()

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 10:15:47 PDT 2017


junbuml added inline comments.


================
Comment at: lib/Transforms/Scalar/JumpThreading.cpp:2168
+    SelectInst *SI = nullptr;
+    for (Use &U : PN->uses()) {
+      if (ICmpInst *Cmp = dyn_cast<ICmpInst>(U.getUser())) {
----------------
Do you intentionally go through all users of the PHI by removing the check PN->hasOneUse() ?


================
Comment at: lib/Transforms/Scalar/JumpThreading.cpp:2174
+            isa<ConstantInt>(Cmp->getOperand(1 - U.getOperandNo())))
+          if (SelectInst *SelectI = dyn_cast<SelectInst>(Cmp->user_back()))
+            if (isUnfoldCandidate(SelectI, Cmp->use_begin()->get())) {
----------------
Don't you need to check if Cmp is used  as the condition  in  SelectInst ?


Repository:
  rL LLVM

https://reviews.llvm.org/D34762





More information about the llvm-commits mailing list