[PATCH] D43876: [LoopUnroll] Peel off iterations if it makes conditions true/false.

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 13 21:55:21 PDT 2018


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUnrollPeel.cpp:173
+    const SCEV *LeftSCEV = SE.getSCEV(LeftVal);
+    const SCEV *RightSCEV = SE.getSCEV(RightVal);
+    // Check if we have a condition with one AddRec and one non AddRec
----------------
I think you should also check `isKnownPredicate` for `LeftSCEV`, `RightSCEV` at this point and bail if it is trivially known true or false. In this case it makes more sense to eliminate this comparison than try to peel something out.


https://reviews.llvm.org/D43876





More information about the llvm-commits mailing list