[all-commits] [llvm/llvm-project] f0c2a5: [LV] Generalize conditions for sinking instrs for ...
Florian Hahn via All-commits
all-commits at lists.llvm.org
Sat Nov 2 14:10:52 PDT 2019
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: f0c2a5af762e7650a007d9ab7161e754d866b60c
https://github.com/llvm/llvm-project/commit/f0c2a5af762e7650a007d9ab7161e754d866b60c
Author: Florian Hahn <flo at fhahn.com>
Date: 2019-11-02 (Sat, 02 Nov 2019)
Changed paths:
M llvm/lib/Analysis/IVDescriptors.cpp
A llvm/test/Transforms/LoopVectorize/first-order-recurrence-complex.ll
Log Message:
-----------
[LV] Generalize conditions for sinking instrs for first order recurrences.
If the recurrence PHI node has a single user, we can sink any
instruction without side effects, given that all users are dominated by
the instruction computing the incoming value of the next iteration
('Previous'). We can sink instructions that may cause traps, because
that only causes the trap to occur later, but not on any new paths.
With the relaxed check, we also have to make sure that we do not have a
direct cycle (meaning PHI user == 'Previous), which indicates a
reduction relation, which potentially gets missed by
ReductionDescriptor.
As follow-ups, we can also sink stores, iff they do not alias with
other instructions we move them across and we could also support sinking
chains of instructions and multiple users of the PHI.
Fixes PR43398.
Reviewers: hsaito, dcaballe, Ayal, rengolin
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D69228
More information about the All-commits
mailing list