[PATCH] D46203: [InstCombine] Widen guards with conditions between

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 2 18:52:29 PDT 2018


mkazantsev added a comment.

I would suggest a slightly different approach to handle such situations. Whenever we see consecutive guard followed by an instruction that is safe to speculate, we can just swap them. Doing so, we will collect all guards in one continuous sequence after all speculable code. And then we just fold consecutive pairs. What do you think about it?



================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:3631
     Instruction *NextInst = II->getNextNode();
+    for (int i = 0; i < 3; i++) {
+      // Note: Using context-free form to avoid compile time blow up
----------------
How about having this number as an option rather than a hard-coded constant?


Repository:
  rL LLVM

https://reviews.llvm.org/D46203





More information about the llvm-commits mailing list