Update PEI's virtual-register-based scavenging to support multiple simultaneous mappings
authorHal Finkel <hfinkel@anl.gov>
Tue, 26 Mar 2013 18:56:54 +0000 (18:56 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 26 Mar 2013 18:56:54 +0000 (18:56 +0000)
commit8846129f6eb58982a2cac22306c8c9b586084475
treebd24c433fd6347a3238caebe8f4636ed48b80725
parentb4f60e9f772de7152a0880d84c5ef511f6d2c642
Update PEI's virtual-register-based scavenging to support multiple simultaneous mappings

The previous algorithm could not deal properly with scavenging multiple virtual
registers because it kept only one live virtual -> physical mapping (and
iterated through operands in order). Now we don't maintain a current mapping,
but rather use replaceRegWith to completely remove the virtual register as
soon as the mapping is established.

In order to allow the register scavenger to return a physical register killed
by an instruction for definition by that same instruction, we now call
RS->forward(I) prior to eliminating virtual registers defined in I. This
requires a minor update to forward to ignore virtual registers.

These new features will be tested in forthcoming commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178058 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/RegisterScavenging.h
lib/CodeGen/PrologEpilogInserter.cpp
lib/CodeGen/RegisterScavenging.cpp
test/CodeGen/AArch64/alloca.ll