summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitae219e24ba9f83a31b774dac0abf2d352b179730 (patch)
tree73b36bfac8133df9b792925e20714f36c9a463c3 /llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
parent00ee3ee0d39c2080a3d060334bac7558b844d395 (diff)
downloadbcm5719-llvm-ae219e24ba9f83a31b774dac0abf2d352b179730.tar.gz
bcm5719-llvm-ae219e24ba9f83a31b774dac0abf2d352b179730.zip
A single MachineInstr operand may now be both a def and a use.
llvm-svn: 2825
Diffstat (limited to 'llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
index 297b64a93c7..774bdc7cd7b 100644
--- a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
+++ b/llvm/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()
OpenPOWER on IntegriCloud