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)
commit4e05788cc3d75a8b413aaa629ba813ce38d288a1
tree10dec5c8a865fc3a94fbe8deba04724eddd04186
parent7c0788b2d91bdbaa5d58fb96234fd153c18c293c
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.

llvm-svn: 178058
llvm/include/llvm/CodeGen/RegisterScavenging.h
llvm/lib/CodeGen/PrologEpilogInserter.cpp
llvm/lib/CodeGen/RegisterScavenging.cpp
llvm/test/CodeGen/AArch64/alloca.ll