diff options
author | Ayal Zaks <ayal.zaks@intel.com> | 2017-06-30 21:05:06 +0000 |
---|---|---|
committer | Ayal Zaks <ayal.zaks@intel.com> | 2017-06-30 21:05:06 +0000 |
commit | 2ff59d4350ba41837ec583e0ff3a2425e88d2ee4 (patch) | |
tree | 3ecccd86a605782f27e6640d587a5c93161798d5 /llvm/include | |
parent | 33d0a1ccd31dd10f227cba98e3daa4561b41ad71 (diff) | |
download | bcm5719-llvm-2ff59d4350ba41837ec583e0ff3a2425e88d2ee4.tar.gz bcm5719-llvm-2ff59d4350ba41837ec583e0ff3a2425e88d2ee4.zip |
[LV] Sink casts to unravel first order recurrence
Check if a single cast is preventing handling a first-order-recurrence Phi,
because the scheduling constraints it imposes on the first-order-recurrence
shuffle are infeasible; but they can be made feasible by moving the cast
downwards. Record such casts and move them when vectorizing the loop.
Differential Revision: https://reviews.llvm.org/D33058
llvm-svn: 306884
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/Transforms/Utils/LoopUtils.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/LoopUtils.h b/llvm/include/llvm/Transforms/Utils/LoopUtils.h index 0397eb95e76..1344285917b 100644 --- a/llvm/include/llvm/Transforms/Utils/LoopUtils.h +++ b/llvm/include/llvm/Transforms/Utils/LoopUtils.h @@ -184,9 +184,14 @@ public: /// Returns true if Phi is a first-order recurrence. A first-order recurrence /// is a non-reduction recurrence relation in which the value of the /// recurrence in the current loop iteration equals a value defined in the - /// previous iteration. - static bool isFirstOrderRecurrence(PHINode *Phi, Loop *TheLoop, - DominatorTree *DT); + /// previous iteration. \p SinkAfter includes pairs of instructions where the + /// first will be rescheduled to appear after the second if/when the loop is + /// vectorized. It may be augmented with additional pairs if needed in order + /// to handle Phi as a first-order recurrence. + static bool + isFirstOrderRecurrence(PHINode *Phi, Loop *TheLoop, + DenseMap<Instruction *, Instruction *> &SinkAfter, + DominatorTree *DT); RecurrenceKind getRecurrenceKind() { return Kind; } |