summaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-05 19:04:31 +0000
committerChris Lattner <sabre@nondot.org>2005-03-05 19:04:31 +0000
commit3267265d781822ca43ccc2816913fc65dfccfd6d (patch)
treee6a5d772b095e9695f4c61bb724c1114803300a8 /lib/Analysis/DataStructure/Local.cpp
parent262bb9ae5e5d31150f2efd80cf5880bf8fb9fbec (diff)
downloadllvm-3267265d781822ca43ccc2816913fc65dfccfd6d.tar.gz
llvm-3267265d781822ca43ccc2816913fc65dfccfd6d.tar.bz2
llvm-3267265d781822ca43ccc2816913fc65dfccfd6d.tar.xz
Make sure the two arguments of a setcc instruction point to the same node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--lib/Analysis/DataStructure/Local.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index 070b695b34..20f45a7b27 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/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())