aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-04-05 19:16:56 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-04-06 18:36:29 +0200
commit8d75df14389bddc4a546cf059d223e730539bc53 (patch)
tree29ca0541de2831670ad4c0cdfe4ddc6657d63670 /llvm/lib/CodeGen/ReachingDefAnalysis.cpp
parent1c924486564461810903603542ffc2d7db204dde (diff)
downloadllvm-8d75df14389bddc4a546cf059d223e730539bc53.zip
llvm-8d75df14389bddc4a546cf059d223e730539bc53.tar.gz
llvm-8d75df14389bddc4a546cf059d223e730539bc53.tar.bz2
[RDA] Don't adjust ReachingDefDefaultVal (NFCI)
At the end of a basic block, RDA adjusts all the reaching defs it found to be relative to the end of the basic block, rather than the start of it. However, it also does this to registers which don't have a reaching def, indicated by ReachingDefDefaultVal. This means that code checking against ReachingDefDefaultVal will not skip them, and may insert them into the reaching definition list. This is ultimately harmless, but causes unnecessary work and is logically not right. Differential Revision: https://reviews.llvm.org/D77506
Diffstat (limited to 'llvm/lib/CodeGen/ReachingDefAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/ReachingDefAnalysis.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/ReachingDefAnalysis.cpp b/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
index 6029250..8695297 100644
--- a/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
+++ b/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
@@ -110,7 +110,8 @@ void ReachingDefAnalysis::leaveBasicBlock(
// only cares about the clearance from the end of the block, so adjust
// everything to be relative to the end of the basic block.
for (int &OutLiveReg : MBBOutRegsInfos[MBBNumber])
- OutLiveReg -= CurInstr;
+ if (OutLiveReg != ReachingDefDefaultVal)
+ OutLiveReg -= CurInstr;
LiveRegs.clear();
}