Remove ARM isel hacks that fold large immediates into a pair of add, sub, and,
authorEvan Cheng <evan.cheng@apple.com>
Wed, 17 Nov 2010 20:13:28 +0000 (20:13 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 17 Nov 2010 20:13:28 +0000 (20:13 +0000)
commitc4af4638dfdab0dc3b6257276cfad2ee45053060
treec09b56536b88953a85defe07d095b13cfa625b03
parentf2dc4aa562e2478a73fe5aeeeec16b1e496a0642
Remove ARM isel hacks that fold large immediates into a pair of add, sub, and,
and xor. The 32-bit move immediates can be hoisted out of loops by machine
LICM but the isel hacks were preventing them.

Instead, let peephole optimization pass recognize registers that are defined by
immediates and the ARM target hook will fold the immediates in.

Other changes include 1) do not fold and / xor into cmp to isel TST / TEQ
instructions if there are multiple uses. This happens when the 'and' is live
out, machine sink would have sinked the computation and that ends up pessimizing
code. The peephole pass would recognize situations where the 'and' can be
toggled to define CPSR and eliminate the comparison anyway.

2) Move peephole pass to after machine LICM, sink, and CSE to avoid blocking
important optimizations.

rdar://8663787, rdar://8241368

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119548 91177308-0d34-0410-b5e6-96231b3b80d8
18 files changed:
include/llvm/Target/Target.td
include/llvm/Target/TargetInstrDesc.h
include/llvm/Target/TargetInstrInfo.h
lib/CodeGen/LLVMTargetMachine.cpp
lib/CodeGen/PeepholeOptimizer.cpp
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMBaseInstrInfo.h
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMInstrThumb.td
lib/Target/ARM/ARMInstrThumb2.td
test/CodeGen/ARM/arm-and-tst-peephole.ll
test/CodeGen/ARM/select_xform.ll
test/CodeGen/Thumb2/machine-licm.ll
test/CodeGen/Thumb2/thumb2-mov.ll
test/CodeGen/Thumb2/thumb2-select_xform.ll
utils/TableGen/CodeGenInstruction.cpp
utils/TableGen/CodeGenInstruction.h
utils/TableGen/InstrInfoEmitter.cpp