Thumb2 IT blocks are fairly expensive. When there are multiple selects using
authorEvan Cheng <evan.cheng@apple.com>
Wed, 9 Jun 2010 01:46:50 +0000 (01:46 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 9 Jun 2010 01:46:50 +0000 (01:46 +0000)
commitd84712421121744797210a7814aafce8c5377d92
tree145a6dcf84fe04b550119feb6eea2bef67ec8f76
parent6c060dbf842e483e20d3a25fbd916f1a875cbf28
Thumb2 IT blocks are fairly expensive. When there are multiple selects using
the same condition, it's important to make sure they are scheduled together
to avoid forming multiple IT blocks. I'm adding a pre-regalloc pass that forms
IT blocks early (by re-scheduling instructions and split basic blocks) to
attempt to fix this. This is not turned on by default since I am not sure this
is the right fix.

Another issue is llvm selects are modeled as two-address conditional moves.
This can be very bad when the copies before the conditional moves are not
coalesced away. Teach IT formation pass to move the copies above the IT block
(when legal) to avoid breaking the IT block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105669 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARM.h
lib/Target/ARM/ARMTargetMachine.cpp
lib/Target/ARM/Thumb2ITBlockPass.cpp