[PATCH] D33058: [LV] Sink casts to unravel first order recurrence

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 04:52:13 PDT 2017


Ayal added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:564
+    auto *I = Phi->user_back();
+    if (I->isCast() && (I->getParent() == Phi->getParent()) && I->hasOneUse() &
+        DT->dominates(Previous, I->user_back())) {
----------------
Ayal wrote:
> aemerson wrote:
> > Bug here, bitwise `&` used. Which is also telling me that there aren't sufficient tests for this, especially the case where Previous doesn't dominate the cast's user and so the cast can't be legally sunk past Previous.
> Right, thanks!
Fixed. (Missing '&' fell off column 80 I guess ;-)

Added a test as mentioned above where Previous (the load) doesn't dominate the cast's user, so the cast cannot be legally sunk past Previous w/o sinking this user along with it.


https://reviews.llvm.org/D33058





More information about the llvm-commits mailing list