diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2003-12-14 13:24:17 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2003-12-14 13:24:17 +0000 |
commit | 4d7af65903cbc858464362e70a6adf499982ec8a (patch) | |
tree | 5f40fb851e4f08c9aa8ebe952bb876ccb02c2ffb /lib/Target/X86 | |
parent | 97323a47d88315b98e5ac38d64ba2a9e3f02b501 (diff) | |
download | external_llvm-4d7af65903cbc858464362e70a6adf499982ec8a.zip external_llvm-4d7af65903cbc858464362e70a6adf499982ec8a.tar.gz external_llvm-4d7af65903cbc858464362e70a6adf499982ec8a.tar.bz2 |
Change interface of MachineOperand as follows:
a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
b) add isUse(), isDef()
c) rename opHiBits32() to isHiBits32(),
opLoBits32() to isLoBits32(),
opHiBits64() to isHiBits64(),
opLoBits64() to isLoBits64().
This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/PeepholeOptimizer.cpp | 4 | ||||
-rw-r--r-- | lib/Target/X86/Printer.cpp | 9 | ||||
-rw-r--r-- | lib/Target/X86/X86AsmPrinter.cpp | 9 | ||||
-rw-r--r-- | lib/Target/X86/X86PeepholeOpt.cpp | 4 |
4 files changed, 10 insertions, 16 deletions
diff --git a/lib/Target/X86/PeepholeOptimizer.cpp b/lib/Target/X86/PeepholeOptimizer.cpp index 4c887e1..89008ae 100644 --- a/lib/Target/X86/PeepholeOptimizer.cpp +++ b/lib/Target/X86/PeepholeOptimizer.cpp @@ -174,7 +174,7 @@ namespace { MachineInstr *MI = *I; for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { MachineOperand &MO = MI->getOperand(i); - if (MO.isVirtualRegister() && MO.opIsDefOnly()) + if (MO.isVirtualRegister() && MO.isDef() && !MO.isUse()) setDefinition(MO.getReg(), MI); } } @@ -233,7 +233,7 @@ namespace { /// register, return the machine instruction defining it, otherwise, return /// null. MachineInstr *getDefiningInst(MachineOperand &MO) { - if (!MO.opIsUse() || !MO.isVirtualRegister()) return 0; + if (MO.isDef() || !MO.isVirtualRegister()) return 0; return UDC->getDefinition(MO.getReg()); } diff --git a/lib/Target/X86/Printer.cpp b/lib/Target/X86/Printer.cpp index 289a68b..4d586c0 100644 --- a/lib/Target/X86/Printer.cpp +++ b/lib/Target/X86/Printer.cpp @@ -551,8 +551,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) { } } else { unsigned i = 0; - if (MI->getNumOperands() && (MI->getOperand(0).opIsDefOnly() || - MI->getOperand(0).opIsDefAndUse())) { + if (MI->getNumOperands() && MI->getOperand(0).isDef()) { printOp(MI->getOperand(0)); O << " = "; ++i; @@ -561,11 +560,9 @@ void Printer::printMachineInstruction(const MachineInstr *MI) { for (unsigned e = MI->getNumOperands(); i != e; ++i) { O << " "; - if (MI->getOperand(i).opIsDefOnly() || - MI->getOperand(i).opIsDefAndUse()) O << "*"; + if (MI->getOperand(i).isDef()) O << "*"; printOp(MI->getOperand(i)); - if (MI->getOperand(i).opIsDefOnly() || - MI->getOperand(i).opIsDefAndUse()) O << "*"; + if (MI->getOperand(i).isDef()) O << "*"; } } O << "\n"; diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index 289a68b..4d586c0 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -551,8 +551,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) { } } else { unsigned i = 0; - if (MI->getNumOperands() && (MI->getOperand(0).opIsDefOnly() || - MI->getOperand(0).opIsDefAndUse())) { + if (MI->getNumOperands() && MI->getOperand(0).isDef()) { printOp(MI->getOperand(0)); O << " = "; ++i; @@ -561,11 +560,9 @@ void Printer::printMachineInstruction(const MachineInstr *MI) { for (unsigned e = MI->getNumOperands(); i != e; ++i) { O << " "; - if (MI->getOperand(i).opIsDefOnly() || - MI->getOperand(i).opIsDefAndUse()) O << "*"; + if (MI->getOperand(i).isDef()) O << "*"; printOp(MI->getOperand(i)); - if (MI->getOperand(i).opIsDefOnly() || - MI->getOperand(i).opIsDefAndUse()) O << "*"; + if (MI->getOperand(i).isDef()) O << "*"; } } O << "\n"; diff --git a/lib/Target/X86/X86PeepholeOpt.cpp b/lib/Target/X86/X86PeepholeOpt.cpp index 4c887e1..89008ae 100644 --- a/lib/Target/X86/X86PeepholeOpt.cpp +++ b/lib/Target/X86/X86PeepholeOpt.cpp @@ -174,7 +174,7 @@ namespace { MachineInstr *MI = *I; for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { MachineOperand &MO = MI->getOperand(i); - if (MO.isVirtualRegister() && MO.opIsDefOnly()) + if (MO.isVirtualRegister() && MO.isDef() && !MO.isUse()) setDefinition(MO.getReg(), MI); } } @@ -233,7 +233,7 @@ namespace { /// register, return the machine instruction defining it, otherwise, return /// null. MachineInstr *getDefiningInst(MachineOperand &MO) { - if (!MO.opIsUse() || !MO.isVirtualRegister()) return 0; + if (MO.isDef() || !MO.isVirtualRegister()) return 0; return UDC->getDefinition(MO.getReg()); } |