Add an MCID::Select flag and TII hooks for optimizing selects.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 16 Aug 2012 23:11:47 +0000 (23:11 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 16 Aug 2012 23:11:47 +0000 (23:11 +0000)
commitf2c64ef519b38a4328809b27b4a3a8e0c26e9709
treece3233b4960acdefe47ab3644925c8196a84e3c3
parent05b2bc8781d9af403a257599613e12cb8fef19e8
Add an MCID::Select flag and TII hooks for optimizing selects.

Select instructions pick one of two virtual registers based on a
condition, like x86 cmov. On targets like ARM that support predication,
selects can sometimes be eliminated by predicating the instruction
defining one of the operands.

Teach PeepholeOptimizer to recognize select instructions, and ask the
target to optimize them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162059 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineInstr.h
include/llvm/MC/MCInstrDesc.h
include/llvm/Target/Target.td
include/llvm/Target/TargetInstrInfo.h
lib/CodeGen/PeepholeOptimizer.cpp
utils/TableGen/CodeGenInstruction.cpp
utils/TableGen/CodeGenInstruction.h
utils/TableGen/InstrInfoEmitter.cpp