diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2009-02-06 17:17:30 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2009-02-06 17:17:30 +0000 |
| commit | b5f0ec3eb7d97f231b12f30985b463d6740713ba (patch) | |
| tree | 89d18dd6edc12ad2d5e29173e8a79771505683d4 /llvm/lib/Target | |
| parent | afdf90ae64416dc0a2adb23b224c272b3132b125 (diff) | |
| download | bcm5719-llvm-b5f0ec3eb7d97f231b12f30985b463d6740713ba.tar.gz bcm5719-llvm-b5f0ec3eb7d97f231b12f30985b463d6740713ba.zip | |
Add TargetInstrInfo::isSafeToMoveRegisterClassDefs. It returns true if it's safe to move an instruction which defines a value in the register class. Replace pre-splitting specific IgnoreRegisterClassBarriers with this new hook.
llvm-svn: 63936
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.h | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 8e3985f0998..577884969b3 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -2483,11 +2483,11 @@ ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const { } bool X86InstrInfo:: -IgnoreRegisterClassBarriers(const TargetRegisterClass *RC) const { - // FIXME: Ignore bariers of x87 stack registers for now. We can't +isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const { + // FIXME: Return false for x87 stack register classes for now. We can't // allow any loads of these registers before FpGet_ST0_80. - return RC == &X86::CCRRegClass || RC == &X86::RFP32RegClass || - RC == &X86::RFP64RegClass || RC == &X86::RFP80RegClass; + return !(RC == &X86::CCRRegClass || RC == &X86::RFP32RegClass || + RC == &X86::RFP64RegClass || RC == &X86::RFP80RegClass); } const TargetRegisterClass *X86InstrInfo::getPointerRegClass() const { diff --git a/llvm/lib/Target/X86/X86InstrInfo.h b/llvm/lib/Target/X86/X86InstrInfo.h index 077de56a5d5..eba0baf3cae 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.h +++ b/llvm/lib/Target/X86/X86InstrInfo.h @@ -406,10 +406,9 @@ public: virtual bool ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const; - /// IgnoreRegisterClassBarriers - Returns true if pre-register allocation - /// live interval splitting pass should ignore barriers of the specified - /// register class. - bool IgnoreRegisterClassBarriers(const TargetRegisterClass *RC) const; + /// isSafeToMoveRegClassDefs - Return true if it's safe to move a machine + /// instruction that defines the specified register class. + bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const; const TargetRegisterClass *getPointerRegClass() const; |

