aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
diff options
context:
space:
mode:
authorSam Parker <sam.parker@arm.com>2020-09-30 09:36:57 +0100
committerSam Parker <sam.parker@arm.com>2020-09-30 09:37:24 +0100
commit779a8a028f53f16234b41e5252b805304788b989 (patch)
treef71d5ab1021a0c45b8d443e610da753ee16bd7b7 /llvm/lib/CodeGen/ReachingDefAnalysis.cpp
parent8392685c2b9f3c2025100dd25b6c6e5eae312d92 (diff)
downloadllvm-779a8a028f53f16234b41e5252b805304788b989.zip
llvm-779a8a028f53f16234b41e5252b805304788b989.tar.gz
llvm-779a8a028f53f16234b41e5252b805304788b989.tar.bz2
[ARM][LowOverheadLoops] TryRemove helper.
Make a helper function that wraps around RDA::isSafeToRemove and utilises the existing DCE IT block checks.
Diffstat (limited to 'llvm/lib/CodeGen/ReachingDefAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/ReachingDefAnalysis.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ReachingDefAnalysis.cpp b/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
index 63989bd..e94e547 100644
--- a/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
+++ b/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
@@ -635,6 +635,9 @@ void ReachingDefAnalysis::collectKilledOperands(MachineInstr *MI,
InstSet &Dead) const {
Dead.insert(MI);
auto IsDead = [this, &Dead](MachineInstr *Def, int PhysReg) {
+ if (mayHaveSideEffects(*Def))
+ return false;
+
unsigned LiveDefs = 0;
for (auto &MO : Def->operands()) {
if (!isValidRegDef(MO))