aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-07-08 22:56:34 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-07-08 22:56:34 +0000
commit9afa88c3a73187b9454085651807896002e020ca (patch)
treef3ed8a8de43d3ed48cb6b6dc841157ae28b70d81 /lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
parent5023bd4a64e6a6926c5a158bbe9957136e554f10 (diff)
A single MachineInstr operand may now be both a def and a use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp')
-rw-r--r--lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
index 297b64a93c..774bdc7cd7 100644
--- a/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
+++ b/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
@@ -8,6 +8,7 @@
#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h"
#include "BBLiveVar.h"
#include "llvm/CodeGen/MachineInstr.h"
+#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
#include "llvm/Support/CFG.h"
#include "Support/PostOrderIterator.h"
#include "Support/SetOperations.h"
@@ -216,13 +217,15 @@ static void applyTranferFuncForMInst(ValueSet &LVS, const MachineInstr *MInst) {
for (MachineInstr::const_val_op_iterator OpI = MInst->begin(),
OpE = MInst->end(); OpI != OpE; ++OpI) {
if (!isa<BasicBlock>(*OpI)) // don't process labels
- if (!OpI.isDef()) // add only if this operand is a use
+ // add only if this operand is a use
+ if (!OpI.isDef() || 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))
+ if (!MInst->implicitRefIsDefined(i) ||
+ MInst->implicitRefIsDefinedAndUsed(i))
LVS.insert(MInst->getImplicitRef(i));
}
@@ -233,7 +236,7 @@ static void applyTranferFuncForMInst(ValueSet &LVS, const MachineInstr *MInst) {
//-----------------------------------------------------------------------------
void FunctionLiveVarInfo::calcLiveVarSetsForBB(const BasicBlock *BB) {
- const MachineCodeForBasicBlock &MIVec = BB->getMachineInstrVec();
+ const MachineCodeForBasicBlock &MIVec = MachineCodeForBasicBlock::get(BB);
if (DEBUG_LV >= LV_DEBUG_Instr)
std::cerr << "\n======For BB " << BB->getName()