Fix a long-standing wart in the code generator: two-address instruction lowering
authorChris Lattner <sabre@nondot.org>
Tue, 5 Sep 2006 02:12:02 +0000 (02:12 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 5 Sep 2006 02:12:02 +0000 (02:12 +0000)
commit2926869b4a083fc951484de03a9867eabf81e880
treed5a3563e0fd5e35bed241a405a34af2bd5202994
parent89c0b4a90eb86756dd83ac20216fc55a38c87376
Fix a long-standing wart in the code generator: two-address instruction lowering
actually *removes* one of the operands, instead of just assigning both operands
the same register.  This make reasoning about instructions unnecessarily complex,
because you need to know if you are before or after register allocation to match
up operand #'s with the target description file.

Changing this also gets rid of a bunch of hacky code in various places.

This patch also includes changes to fold loads into cmp/test instructions in
the X86 backend, along with a significant simplification to the X86 spill
folding code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30108 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LiveIntervalAnalysis.cpp
lib/CodeGen/RegAllocSimple.cpp
lib/CodeGen/TwoAddressInstructionPass.cpp
lib/CodeGen/VirtRegMap.cpp
lib/CodeGen/VirtRegMap.h
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86RegisterInfo.cpp
lib/Target/X86/X86RegisterInfo.h
utils/TableGen/AsmWriterEmitter.cpp