[PATCH] D54366: RegAllocFast: Add heuristic to detect values not live-out of a block

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 08:50:56 PDT 2019


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

LGTM. Nitpicks below.



================
Comment at: lib/CodeGen/RegAllocFast.cpp:106
+    /// that it is alive accross blocks.
+    BitVector MayLiveAcrossBlocks;
+
----------------
The typo is in the comment is still here :).


================
Comment at: lib/CodeGen/RegAllocFast.cpp:282
+    }
+  }
+
----------------
Just a thought, given that we already traversed all the instructions of MBB at this point, we could avoid this loop all together by checking if we saw as many uses as the total number of uses for each virtual register.
That would be valuable only if checking the total number of the uses is O(1), which I am not sure it is right now. Basically, although we have a limit of 8 in that patch, I am worried this loop might have an impact on compile time.

Bonus, if we were to do that, we would know what the status for the back-edges case.

Anyhow, nothing to do here!


================
Comment at: lib/CodeGen/RegAllocFast.cpp:1057
     LLVM_DEBUG(dbgs() << "  Spilling remaining registers before call.\n");
-    spillAll(MI);
+    spillAll(MI, false);
   }
----------------
For clarity
/*OnlyLiveOut=*/false


================
Comment at: lib/CodeGen/RegAllocFast.cpp:1167
   LLVM_DEBUG(dbgs() << "Spilling live registers at end of block.\n");
-  spillAll(MBB.getFirstTerminator());
+  spillAll(MBB.getFirstTerminator(), true);
 
----------------
Ditto


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

https://reviews.llvm.org/D54366





More information about the llvm-commits mailing list