[MachineLICM] First steps of sinking GEPs near calls.
authorDaniel Jasper <djasper@google.com>
Sat, 14 Mar 2015 10:58:38 +0000 (10:58 +0000)
committerDaniel Jasper <djasper@google.com>
Sat, 14 Mar 2015 10:58:38 +0000 (10:58 +0000)
commit439cc2c5de80f5810c1733445673658a446d4a0c
tree5a5b4fe39ccb2cdb44eeff121fd41a96f3098efa
parente282854e63a56e4f4bfc4468726d8303d0ea4c6f
[MachineLICM] First steps of sinking GEPs near calls.

Specifically, if there are copy-like instructions in the loop header
they are moved into the loop close to their uses. This reduces the live
intervals of the values and can avoid register spills.

This is working towards a fix for http://llvm.org/PR22230.
Review: http://reviews.llvm.org/D7259

Next steps:
- Find a better cost model (which non-copy instructions should be sunk?)
- Make this dependent on register pressure

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232262 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineLICM.cpp
test/CodeGen/X86/sink-cheap-instructions.ll [new file with mode: 0644]