[PATCH] D62249: RegAllocFast: Set MayLiveAcrossBlocks when allocating uses

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 19:15:49 PDT 2019


arsenm added inline comments.


================
Comment at: lib/CodeGen/RegAllocFast.cpp:297
+  if (MayLiveAcrossBlocks.test(TargetRegisterInfo::virtReg2Index(VirtReg)))
+    return true;
+
----------------
qcolombet wrote:
> arsenm wrote:
> > qcolombet wrote:
> > > We should return `!MBB->pred_empty()`
> > Does it matter for an unreachable block?
> It could be the entry block, couldn't it?
This doesn't really matter because the entry block is always visited first


================
Comment at: lib/CodeGen/RegAllocFast.cpp:310
+  return false;
+}
+
----------------
qcolombet wrote:
> Refactoring suggestion:
> Use the same base code for both live-in and live-out the difference being:
> 1. The returned value for early exits (pred_empty vs such_empty)
> 2. The list we iterate on (defs vs uses)
I tried this, but largely due to the return inside the block, it gets pretty ugly


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62249/new/

https://reviews.llvm.org/D62249





More information about the llvm-commits mailing list