This patch ensures that when we detect first-order recurrences, we reject a phi node if its previous is also a phi node. During vectorization the initial and previous values of the recurrence are shuffled together to create the value for the current iteration. However, phi nodes are not widened like other instructions. This fixes PR27246.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM with a minor nit.
lib/Transforms/Utils/LoopUtils.cpp | ||
---|---|---|
544 | This looks like your combining the fix with a NFC (i.e., replacing the original check with isLoopInvariant()). I'd prefer this patch only include the isa<PHINode> check and you can make the NFC in a subsequent patch. |
This looks like your combining the fix with a NFC (i.e., replacing the original check with isLoopInvariant()). I'd prefer this patch only include the isa<PHINode> check and you can make the NFC in a subsequent patch.