[PATCH] D77506: [RDA] Don't adjust ReachingDefDefaultVal (NFCI)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 5 10:40:25 PDT 2020


nikic created this revision.
nikic added reviewers: samparker, SjoerdMeijer, craig.topper.
Herald added subscribers: llvm-commits, danielkiss, kristof.beyls.
Herald added a project: LLVM.

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 at the entry of a successor block, we end up not skipping these incoming reaching definitions, and insert them into the reaching definition list. This is ultimately harmless, but causes unnecessary work and is logically not right.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77506

Files:
  lib/CodeGen/ReachingDefAnalysis.cpp


Index: lib/CodeGen/ReachingDefAnalysis.cpp
===================================================================
--- lib/CodeGen/ReachingDefAnalysis.cpp
+++ lib/CodeGen/ReachingDefAnalysis.cpp
@@ -110,7 +110,8 @@
   // 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();
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77506.255176.patch
Type: text/x-patch
Size: 534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200405/31171705/attachment.bin>


More information about the llvm-commits mailing list