From 8d75df14389bddc4a546cf059d223e730539bc53 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 5 Apr 2020 19:16:56 +0200 Subject: [PATCH] [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 --- llvm/lib/CodeGen/ReachingDefAnalysis.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); } -- 2.7.4