diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2003-05-27 00:06:48 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2003-05-27 00:06:48 +0000 |
commit | a22eace55bb17af2728ca494b6d4557bdad82a09 (patch) | |
tree | 10b0eff58074b793ed4f5417dd83189558542be1 /lib | |
parent | 5f2180c53330502eb2f0f5bf3f21a838ad800906 (diff) |
Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
and related functions and flags. Fixed several bugs where only
"isDef" was being checked, not "isDefAndUse".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6342 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/LiveVar/BBLiveVar.cpp | 8 | ||||
-rw-r--r-- | lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp | 13 | ||||
-rw-r--r-- | lib/Target/SparcV9/LiveVar/BBLiveVar.cpp | 8 | ||||
-rw-r--r-- | lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp | 13 |
4 files changed, 22 insertions, 20 deletions
diff --git a/lib/Analysis/LiveVar/BBLiveVar.cpp b/lib/Analysis/LiveVar/BBLiveVar.cpp index 81d3b529f3..3968430ca5 100644 --- a/lib/Analysis/LiveVar/BBLiveVar.cpp +++ b/lib/Analysis/LiveVar/BBLiveVar.cpp @@ -64,12 +64,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.isDef()) // add to Defs only if this operand is a def + if (OpI.isDefOnly() || OpI.isDefAndUse()) // 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->implicitRefIsDefined(i)) + if (MI->getImplicitOp(i).opIsDefOnly() || MI->getImplicitOp(i).opIsDefAndUse()) addDef(MI->getImplicitRef(i)); // iterate over MI operands to find uses @@ -80,7 +80,7 @@ void BBLiveVar::calcDefUseSets() { if (isa<BasicBlock>(Op)) continue; // don't process labels - if (!OpI.isDef() || OpI.isDefAndUse()) { + if (OpI.isUseOnly() || OpI.isDefAndUse()) { // add to Uses only if this operand is a use // // *** WARNING: The following code for handling dummy PHI machine @@ -116,7 +116,7 @@ void BBLiveVar::calcDefUseSets() { if (Op->getType() == Type::LabelTy) // don't process labels continue; - if (!MI->implicitRefIsDefined(i) || MI->implicitRefIsDefinedAndUsed(i) ) + if (MI->getImplicitOp(i).opIsUse() || MI->getImplicitOp(i).opIsDefAndUse()) addUse(Op); } } // for all machine instructions diff --git a/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp index 371cecdd5d..63c20194df 100644 --- a/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp +++ b/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp @@ -213,13 +213,14 @@ 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.isDef()) // kill only if this operand is a def - LVS.erase(*OpI); // this definition kills any uses + if (OpI.isDefOnly() || OpI.isDefAndUse()) // 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->implicitRefIsDefined(i)) + if (MInst->getImplicitOp(i).opIsDefOnly() || + MInst->getImplicitOp(i).opIsDefAndUse()) LVS.erase(MInst->getImplicitRef(i)); } @@ -227,14 +228,14 @@ 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.isDef() || OpI.isDefAndUse() ) + if (!OpI.isDefOnly() || OpI.isDefAndUse() ) 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->implicitRefIsDefined(i) || - MInst->implicitRefIsDefinedAndUsed(i)) + if (MInst->getImplicitOp(i).opIsUse() || + MInst->getImplicitOp(i).opIsDefAndUse()) LVS.insert(MInst->getImplicitRef(i)); } diff --git a/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp b/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp index 81d3b529f3..3968430ca5 100644 --- a/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp +++ b/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp @@ -64,12 +64,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.isDef()) // add to Defs only if this operand is a def + if (OpI.isDefOnly() || OpI.isDefAndUse()) // 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->implicitRefIsDefined(i)) + if (MI->getImplicitOp(i).opIsDefOnly() || MI->getImplicitOp(i).opIsDefAndUse()) addDef(MI->getImplicitRef(i)); // iterate over MI operands to find uses @@ -80,7 +80,7 @@ void BBLiveVar::calcDefUseSets() { if (isa<BasicBlock>(Op)) continue; // don't process labels - if (!OpI.isDef() || OpI.isDefAndUse()) { + if (OpI.isUseOnly() || OpI.isDefAndUse()) { // add to Uses only if this operand is a use // // *** WARNING: The following code for handling dummy PHI machine @@ -116,7 +116,7 @@ void BBLiveVar::calcDefUseSets() { if (Op->getType() == Type::LabelTy) // don't process labels continue; - if (!MI->implicitRefIsDefined(i) || MI->implicitRefIsDefinedAndUsed(i) ) + if (MI->getImplicitOp(i).opIsUse() || MI->getImplicitOp(i).opIsDefAndUse()) addUse(Op); } } // for all machine instructions diff --git a/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp b/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp index 371cecdd5d..63c20194df 100644 --- a/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp +++ b/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp @@ -213,13 +213,14 @@ 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.isDef()) // kill only if this operand is a def - LVS.erase(*OpI); // this definition kills any uses + if (OpI.isDefOnly() || OpI.isDefAndUse()) // 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->implicitRefIsDefined(i)) + if (MInst->getImplicitOp(i).opIsDefOnly() || + MInst->getImplicitOp(i).opIsDefAndUse()) LVS.erase(MInst->getImplicitRef(i)); } @@ -227,14 +228,14 @@ 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.isDef() || OpI.isDefAndUse() ) + if (!OpI.isDefOnly() || OpI.isDefAndUse() ) 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->implicitRefIsDefined(i) || - MInst->implicitRefIsDefinedAndUsed(i)) + if (MInst->getImplicitOp(i).opIsUse() || + MInst->getImplicitOp(i).opIsDefAndUse()) LVS.insert(MInst->getImplicitRef(i)); } |