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

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 14:54:14 PDT 2019


qcolombet added inline comments.


================
Comment at: lib/CodeGen/RegAllocFast.cpp:297
+  if (MayLiveAcrossBlocks.test(TargetRegisterInfo::virtReg2Index(VirtReg)))
+    return true;
+
----------------
We should return `!MBB->pred_empty()`


================
Comment at: lib/CodeGen/RegAllocFast.cpp:305
+      MayLiveAcrossBlocks.set(TargetRegisterInfo::virtReg2Index(VirtReg));
+      return true;
+    }
----------------
Ditto


================
Comment at: lib/CodeGen/RegAllocFast.cpp:310
+  return false;
+}
+
----------------
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)


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

https://reviews.llvm.org/D62249





More information about the llvm-commits mailing list