aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
diff options
context:
space:
mode:
authorSam Parker <sam.parker@arm.com>2020-08-28 13:56:16 +0100
committerSam Parker <sam.parker@arm.com>2020-08-28 13:56:16 +0100
commitb30adfb5295eaa894669e62eec627adda8820a43 (patch)
treed999bb084d87fc7c6ff6cd38ef46a111df6ee465 /llvm/lib/CodeGen/ReachingDefAnalysis.cpp
parent3c8be94f3d8a82f07f61aeddf834a8cc007175bb (diff)
downloadllvm-b30adfb5295eaa894669e62eec627adda8820a43.zip
llvm-b30adfb5295eaa894669e62eec627adda8820a43.tar.gz
llvm-b30adfb5295eaa894669e62eec627adda8820a43.tar.bz2
[ARM][LowOverheadLoops] Liveouts and reductions
Remove the code that tried to look for reduction patterns, since the vectorizer and isel can now produce predicated arithmetic instructios within the loop body. This has required some reorganisation and fixes around live-out and predication checks, as well as looking for cases where an input/output is initialised to zero. Differential Revision: https://reviews.llvm.org/D86613
Diffstat (limited to 'llvm/lib/CodeGen/ReachingDefAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/ReachingDefAnalysis.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ReachingDefAnalysis.cpp b/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
index cb53ea4..5a48370 100644
--- a/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
+++ b/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
@@ -389,6 +389,19 @@ ReachingDefAnalysis::getGlobalUses(MachineInstr *MI, int PhysReg,
}
}
+void
+ReachingDefAnalysis::getGlobalReachingDefs(MachineInstr *MI, int PhysReg,
+ InstSet &Defs) const {
+ if (auto *Def = getUniqueReachingMIDef(MI, PhysReg)) {
+ Defs.insert(Def);
+ return;
+ }
+
+ SmallPtrSet<MachineBasicBlock *, 2> Visited;
+ for (auto *MBB : MI->getParent()->predecessors())
+ getLiveOuts(MBB, PhysReg, Defs);
+}
+
void ReachingDefAnalysis::getLiveOuts(MachineBasicBlock *MBB, int PhysReg,
InstSet &Defs) const {
SmallPtrSet<MachineBasicBlock*, 2> VisitedBBs;