diff options
author | Chris Lattner <sabre@nondot.org> | 2006-09-05 02:12:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-09-05 02:12:02 +0000 |
commit | 2926869b4a083fc951484de03a9867eabf81e880 (patch) | |
tree | d5a3563e0fd5e35bed241a405a34af2bd5202994 /lib/CodeGen/VirtRegMap.h | |
parent | 89c0b4a90eb86756dd83ac20216fc55a38c87376 (diff) | |
download | external_llvm-2926869b4a083fc951484de03a9867eabf81e880.zip external_llvm-2926869b4a083fc951484de03a9867eabf81e880.tar.gz external_llvm-2926869b4a083fc951484de03a9867eabf81e880.tar.bz2 |
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
Diffstat (limited to 'lib/CodeGen/VirtRegMap.h')
-rw-r--r-- | lib/CodeGen/VirtRegMap.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index 83d5aad..426d1cf 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -23,6 +23,7 @@ namespace llvm { class MachineInstr; + class TargetInstrInfo; class VirtRegMap { public: @@ -31,6 +32,8 @@ namespace llvm { std::pair<unsigned, ModRef> > MI2VirtMapTy; private: + const TargetInstrInfo &TII; + MachineFunction &MF; /// Virt2PhysMap - This is a virtual to physical register /// mapping. Each virtual register is required to have an entry in @@ -58,10 +61,7 @@ namespace llvm { }; public: - VirtRegMap(MachineFunction &mf) - : MF(mf), Virt2PhysMap(NO_PHYS_REG), Virt2StackSlotMap(NO_STACK_SLOT) { - grow(); - } + VirtRegMap(MachineFunction &mf); void grow(); |