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 | aaba4639f8b4e4b516b5d0534e726fe596c21081 (patch) | |
| tree | 1b5d6e541d3ff5c644c4a2e7b5534e5137499573 /llvm/lib/Analysis/LiveVar | |
| parent | fbeb3b02c3d0012b3c56f166905cabd2e4b09706 (diff) | |
| download | bcm5719-llvm-aaba4639f8b4e4b516b5d0534e726fe596c21081.tar.gz bcm5719-llvm-aaba4639f8b4e4b516b5d0534e726fe596c21081.zip | |
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.
llvm-svn: 10461
Diffstat (limited to 'llvm/lib/Analysis/LiveVar')
| -rw-r--r-- | llvm/lib/Analysis/LiveVar/BBLiveVar.cpp | 9 | ||||
| -rw-r--r-- | llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp | 10 |
2 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/LiveVar/BBLiveVar.cpp b/llvm/lib/Analysis/LiveVar/BBLiveVar.cpp index 758f1b1539d..270fbbd830c 100644 --- a/llvm/lib/Analysis/LiveVar/BBLiveVar.cpp +++ b/llvm/lib/Analysis/LiveVar/BBLiveVar.cpp @@ -52,12 +52,12 @@ void BBLiveVar::calcDefUseSets() { // iterate over MI operands to find defs for (MachineInstr::const_val_op_iterator OpI = MI->begin(), OpE = MI->end(); OpI != OpE; ++OpI) - if (OpI.isDefOnly() || OpI.isDefAndUse()) // add to Defs if this operand is a def + if (OpI.isDef()) // add to Defs if this operand is a def addDef(*OpI); // do for implicit operands as well for (unsigned i = 0; i < MI->getNumImplicitRefs(); ++i) - if (MI->getImplicitOp(i).opIsDefOnly() || MI->getImplicitOp(i).opIsDefAndUse()) + if (MI->getImplicitOp(i).isDef()) addDef(MI->getImplicitRef(i)); // iterate over MI operands to find uses @@ -68,8 +68,7 @@ void BBLiveVar::calcDefUseSets() { if (isa<BasicBlock>(Op)) continue; // don't process labels - if (OpI.isUseOnly() || OpI.isDefAndUse()) { - // add to Uses only if this operand is a use + if (OpI.isUse()) { // add to Uses only if this operand is a use // // *** WARNING: The following code for handling dummy PHI machine // instructions is untested. The previous code was broken and I @@ -104,7 +103,7 @@ void BBLiveVar::calcDefUseSets() { if (Op->getType() == Type::LabelTy) // don't process labels continue; - if (MI->getImplicitOp(i).opIsUse() || MI->getImplicitOp(i).opIsDefAndUse()) + if (MI->getImplicitOp(i).isUse()) addUse(Op); } } // for all machine instructions diff --git a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp index 8f0e31811a9..e342760f723 100644 --- a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp +++ b/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp @@ -235,14 +235,13 @@ FunctionLiveVarInfo::getLiveVarSetAfterMInst(const MachineInstr *MI, static void applyTranferFuncForMInst(ValueSet &LVS, const MachineInstr *MInst) { for (MachineInstr::const_val_op_iterator OpI = MInst->begin(), OpE = MInst->end(); OpI != OpE; ++OpI) { - if (OpI.isDefOnly() || OpI.isDefAndUse()) // kill if this operand is a def + if (OpI.isDef()) // kill if this operand is a def LVS.erase(*OpI); // this definition kills any uses } // do for implicit operands as well for (unsigned i=0; i < MInst->getNumImplicitRefs(); ++i) { - if (MInst->getImplicitOp(i).opIsDefOnly() || - MInst->getImplicitOp(i).opIsDefAndUse()) + if (MInst->getImplicitOp(i).isDef()) LVS.erase(MInst->getImplicitRef(i)); } @@ -250,14 +249,13 @@ static void applyTranferFuncForMInst(ValueSet &LVS, const MachineInstr *MInst) { OpE = MInst->end(); OpI != OpE; ++OpI) { if (!isa<BasicBlock>(*OpI)) // don't process labels // add only if this operand is a use - if (!OpI.isDefOnly() || OpI.isDefAndUse() ) + if (OpI.isUse()) LVS.insert(*OpI); // An operand is a use - so add to use set } // do for implicit operands as well for (unsigned i = 0, e = MInst->getNumImplicitRefs(); i != e; ++i) - if (MInst->getImplicitOp(i).opIsUse() || - MInst->getImplicitOp(i).opIsDefAndUse()) + if (MInst->getImplicitOp(i).isUse()) LVS.insert(MInst->getImplicitRef(i)); } |

