diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2009-04-08 21:14:34 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2009-04-08 21:14:34 +0000 |
commit | bca99f759e94c46a5de6dce726ef3a3f70ba374b (patch) | |
tree | 7d025aa19bd757a6367886e31026a87f6650e88a /lib/Target/X86/X86InstrInfo.h | |
parent | 556132b279f711a5521dd4b9f2b40780f573ef15 (diff) | |
download | external_llvm-bca99f759e94c46a5de6dce726ef3a3f70ba374b.zip external_llvm-bca99f759e94c46a5de6dce726ef3a3f70ba374b.tar.gz external_llvm-bca99f759e94c46a5de6dce726ef3a3f70ba374b.tar.bz2 |
Re-apply 68552.
Tested by bootstrapping llvm-gcc and using that to build llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86InstrInfo.h')
-rw-r--r-- | lib/Target/X86/X86InstrInfo.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Target/X86/X86InstrInfo.h b/lib/Target/X86/X86InstrInfo.h index 3bbb51e..e09769e 100644 --- a/lib/Target/X86/X86InstrInfo.h +++ b/lib/Target/X86/X86InstrInfo.h @@ -243,7 +243,7 @@ namespace X86II { }; } -const int X86AddrNumOperands = 4; +const int X86AddrNumOperands = 5; inline static bool isScale(const MachineOperand &MO) { return MO.isImm() && @@ -251,7 +251,7 @@ inline static bool isScale(const MachineOperand &MO) { MO.getImm() == 4 || MO.getImm() == 8); } -inline static bool isMem(const MachineInstr *MI, unsigned Op) { +inline static bool isLeaMem(const MachineInstr *MI, unsigned Op) { if (MI->getOperand(Op).isFI()) return true; return Op+4 <= MI->getNumOperands() && MI->getOperand(Op ).isReg() && isScale(MI->getOperand(Op+1)) && @@ -262,6 +262,13 @@ inline static bool isMem(const MachineInstr *MI, unsigned Op) { MI->getOperand(Op+3).isJTI()); } +inline static bool isMem(const MachineInstr *MI, unsigned Op) { + if (MI->getOperand(Op).isFI()) return true; + return Op+5 <= MI->getNumOperands() && + MI->getOperand(Op+4).isReg() && + isLeaMem(MI, Op); +} + class X86InstrInfo : public TargetInstrInfoImpl { X86TargetMachine &TM; const X86RegisterInfo RI; |