diff options
author | Sam Parker <sam.parker@arm.com> | 2020-07-01 08:27:12 +0100 |
---|---|---|
committer | Sam Parker <sam.parker@arm.com> | 2020-07-01 08:31:49 +0100 |
commit | 3ee580d0176f69a9f724469660f1d1805e0b6a06 (patch) | |
tree | f31dc0d85e453539335d036ae5a5f8f8e100a8be /llvm/lib/CodeGen/ReachingDefAnalysis.cpp | |
parent | ffee8040534495fa739808e6c66a7fc73eca27bb (diff) | |
download | llvm-3ee580d0176f69a9f724469660f1d1805e0b6a06.zip llvm-3ee580d0176f69a9f724469660f1d1805e0b6a06.tar.gz llvm-3ee580d0176f69a9f724469660f1d1805e0b6a06.tar.bz2 |
[ARM][LowOverheadLoops] Handle reductions
While validating live-out values, record instructions that look like
a reduction. This will comprise of a vector op (for now only vadd),
a vorr (vmov) which store the previous value of vadd and then a vpsel
in the exit block which is predicated upon a vctp. This vctp will
combine the last two iterations using the vmov and vadd into a vector
which can then be consumed by a vaddv.
Once we have determined that it's safe to perform tail-predication,
we need to change this sequence of instructions so that the
predication doesn't produce incorrect code. This involves changing
the register allocation of the vadd so it updates itself and the
predication on the final iteration will not update the falsely
predicated lanes. This mimics what the vmov, vctp and vpsel do and
so we then don't need any of those instructions.
Differential Revision: https://reviews.llvm.org/D75533
Diffstat (limited to 'llvm/lib/CodeGen/ReachingDefAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ReachingDefAnalysis.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ReachingDefAnalysis.cpp b/llvm/lib/CodeGen/ReachingDefAnalysis.cpp index ea667f1..5bd8b4b 100644 --- a/llvm/lib/CodeGen/ReachingDefAnalysis.cpp +++ b/llvm/lib/CodeGen/ReachingDefAnalysis.cpp @@ -389,6 +389,12 @@ ReachingDefAnalysis::getGlobalUses(MachineInstr *MI, int PhysReg, } } +void ReachingDefAnalysis::getLiveOuts(MachineBasicBlock *MBB, int PhysReg, + InstSet &Defs) const { + SmallPtrSet<MachineBasicBlock*, 2> VisitedBBs; + getLiveOuts(MBB, PhysReg, Defs, VisitedBBs); +} + void ReachingDefAnalysis::getLiveOuts(MachineBasicBlock *MBB, int PhysReg, InstSet &Defs, BlockSet &VisitedBBs) const { |