Improve virtual frame base register allocation heuristics.
authorJim Grosbach <grosbach@apple.com>
Tue, 31 Aug 2010 17:58:19 +0000 (17:58 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 31 Aug 2010 17:58:19 +0000 (17:58 +0000)
commit864d22ea72ac418ba06feb5e09b18c35ec53b4b2
tree096f78c70b933796708e0691a1bdf5a79ee4b079
parentf3bba4c1aefb1d260793813e60d045d76e52b6d2
Improve virtual frame base register allocation heuristics.

  1. Allocate them in the entry block of the function to enable function-wide
     re-use. The instructions to create them should be re-materializable, so
     there shouldn't be additional cost compared to creating them local
     to the basic blocks where they are used.
  2. Collect all of the frame index references for the function and sort them
     by the local offset referenced. Iterate over the sorted list to
     allocate the virtual base registers. This enables creation of base
     registers optimized for positive-offset access of frame references.
     (Note: This may be appropriate to later be a target hook to do the
     sorting in a target appropriate manner. For now it's done here for
     simplicity.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112609 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LocalStackSlotAllocation.cpp