Add a quick pass to optimize sign / zero extension instructions. For targets where...
authorEvan Cheng <evan.cheng@apple.com>
Wed, 13 Jan 2010 00:30:23 +0000 (00:30 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 13 Jan 2010 00:30:23 +0000 (00:30 +0000)
commit7da9ecf9677b751d81515f95168ae3cb2df54160
tree5d592a77614fbce75d4d1f67d0ec62609b829027
parent5f72a5ebc84a1935878b5b2d3166a505c520cdfc
Add a quick pass to optimize sign / zero extension instructions. For targets where the pre-extension values are available in the subreg of the result of the extension, replace the uses of the pre-extension value with the result + extract_subreg.

For now, this pass is fairly conservative. It only perform the replacement when both the pre- and post- extension values are used in the block. It will miss cases where the post-extension values are live, but not used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93278 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/Passes.h
include/llvm/Target/TargetInstrInfo.h
lib/CodeGen/LLVMTargetMachine.cpp
lib/CodeGen/OptimizeExts.cpp [new file with mode: 0644]
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h
test/CodeGen/X86/2008-08-05-SpillerBug.ll
test/CodeGen/X86/sext-subreg.ll [new file with mode: 0644]
test/CodeGen/X86/stack-color-with-reg.ll