[PATCH] D52010: RegAllocFast: Rewrite and improve

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 9 16:47:33 PST 2018


MatzeB added a comment.

Some notes on what is left here:

- Change allocation direction to go from end to begin of a basic block.
- Change debug value handling: The tricky thing with the changed direction is that we dealing with dangling DBG_VALUE instructions (they have a vreg use after the last non-debug use of a vreg) gets trickier. They are rare but occur in several unittests so we now track them separately in the code and perform a forward walk each time after the vreg is allocation by the real last use to see whether the register reached the dangling DBG_VALUE.
- This also simplifies DBG_VALUE handling, to always referenvce stack slots in case of spills as we now place spills immediately adjacent to the definition of a value/register.
- Generally rewrote `allocateInstruction` to be hopefolly somewhat simpler
- Added some heuristic for tricky inline assembly early clobber situations: If we detect a tricky situation now, we will take all def and early-clobber like operands and sort them by the size of the register class so that we can assign tricky cases more consistently and are more likely to be successfull (this was necessary to fix some unittests that were lucky with the old allocation algorithm but unlucky with the new one. With the new heuristic we should be less dependent on luck).


Repository:
  rL LLVM

https://reviews.llvm.org/D52010





More information about the llvm-commits mailing list