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
This commit is contained in:
Chris Lattner
2006-09-05 02:12:02 +00:00
parent 89c0b4a90e
commit 2926869b4a
9 changed files with 576 additions and 603 deletions

View File

@@ -22,7 +22,7 @@ using namespace llvm;
X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
: TargetInstrInfo(X86Insts, sizeof(X86Insts)/sizeof(X86Insts[0])),
TM(tm) {
TM(tm), RI(*this) {
}

File diff suppressed because it is too large Load Diff

View File

@@ -15,15 +15,15 @@
#define X86REGISTERINFO_H
#include "llvm/Target/MRegisterInfo.h"
class llvm::Type;
#include "X86GenRegisterInfo.h.inc"
namespace llvm {
class Type;
class TargetInstrInfo;
struct X86RegisterInfo : public X86GenRegisterInfo {
X86RegisterInfo();
const TargetInstrInfo &TII;
X86RegisterInfo(const TargetInstrInfo &tii);
/// Code Generation virtual methods...
void storeRegToStackSlot(MachineBasicBlock &MBB,