diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-05 19:04:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-05 19:04:31 +0000 |
commit | 7c832fb0b22184cefd047332d56fb53b71aed821 (patch) | |
tree | a8ab34d088691938b2c89c6d228fa23a47086aee /llvm/lib/Analysis/DataStructure/Local.cpp | |
parent | aa72c889a66bd513ffbe2caf976ed0ce06a45f7d (diff) | |
download | bcm5719-llvm-7c832fb0b22184cefd047332d56fb53b71aed821.tar.gz bcm5719-llvm-7c832fb0b22184cefd047332d56fb53b71aed821.zip |
Make sure the two arguments of a setcc instruction point to the same node.
llvm-svn: 20462
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Local.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Local.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp index 070b695b34c..20f45a7b27d 100644 --- a/llvm/lib/Analysis/DataStructure/Local.cpp +++ b/llvm/lib/Analysis/DataStructure/Local.cpp @@ -112,7 +112,7 @@ namespace { void visitStoreInst(StoreInst &SI); void visitCallInst(CallInst &CI); void visitInvokeInst(InvokeInst &II); - void visitSetCondInst(SetCondInst &SCI) {} // SetEQ & friends are ignored + void visitSetCondInst(SetCondInst &SCI); void visitFreeInst(FreeInst &FI); void visitCastInst(CastInst &CI); void visitInstruction(Instruction &I); @@ -325,6 +325,13 @@ void GraphBuilder::visitSelectInst(SelectInst &SI) { Dest.mergeWith(getValueDest(*SI.getOperand(2))); } +void GraphBuilder::visitSetCondInst(SetCondInst &SCI) { + if (!isPointerType(SCI.getOperand(0)->getType()) || + isa<ConstantPointerNull>(SCI.getOperand(1))) return; // Only pointers + ScalarMap[SCI.getOperand(0)].mergeWith(getValueDest(*SCI.getOperand(1))); +} + + void GraphBuilder::visitGetElementPtrInst(User &GEP) { DSNodeHandle Value = getValueDest(*GEP.getOperand(0)); if (Value.isNull()) |