[PATCH] D41585: [Greedy RegAlloc] Take into account the cost of local intervals when selecting split candidate.

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 10 09:32:24 PST 2018


qcolombet accepted this revision.
qcolombet added a comment.
This revision is now accepted and ready to land.

Hi Marina,

Looks good to me. Couple of nitpicks below.
One question: What is the compile time impact of this new heuristic?

Cheers,
-Quentin



================
Comment at: include/llvm/CodeGen/LiveRegMatrix.h:114
+  /// assigned to PhysReg. If this function returns false, PhysReg is free at
+  /// the segmant [Start, End).
+  bool checkInterference(SlotIndex Start, SlotIndex End, unsigned PhysReg);
----------------
*segment


================
Comment at: lib/CodeGen/LiveRegMatrix.cpp:211
+                                      unsigned PhysReg) {
+  // Construct artificial live range containing only one segment [Start, End)
+  VNInfo valno(0, Start);
----------------
Period at the end of comments


================
Comment at: lib/CodeGen/RegAllocGreedy.cpp:1570
+                                         Order)) {
+        // This interfernce causes local interval to spill, add that cost.
+        GlobalCost += SpillPlacer->getBlockFrequency(BC.Number);
----------------
*interference


================
Comment at: test/CodeGen/X86/bug26810.ll:28
 ; CHECK-NEXT: ADDPDrr
+; CHECK-NEXT: MOVAPSmr
 ; CHECK-NEXT: ADD32ri8
----------------
Why is the new code sequence better?


Repository:
  rL LLVM

https://reviews.llvm.org/D41585





More information about the llvm-commits mailing list