From: Chris Lattner Date: Mon, 22 Jul 2002 16:35:53 +0000 (+0000) Subject: Always create a shadow node for a store instruction, even if it's storing X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=eef796c767407aff5f29bd061a58c99b9b97927b;p=oota-llvm.git Always create a shadow node for a store instruction, even if it's storing a scalar value. Likewise for load instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2990 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index 6d8b1b385dc..6ce3ae08580 100644 --- a/lib/Analysis/DataStructure/Local.cpp +++ b/lib/Analysis/DataStructure/Local.cpp @@ -256,16 +256,16 @@ void GraphBuilder::visitGetElementPtrInst(GetElementPtrInst &GEP) { } void GraphBuilder::visitLoadInst(LoadInst &LI) { - if (!isa(LI.getType())) return; // Only pointer PHIs DSNode *Ptr = getSubscriptedNode(LI, getValueNode(*LI.getOperand(0))); + if (!isa(LI.getType())) return; // Only pointer PHIs getValueNode(LI)->addEdgeTo(getLink(Ptr, 0)); } void GraphBuilder::visitStoreInst(StoreInst &SI) { + DSNode *DestPtr = getSubscriptedNode(SI, getValueNode(*SI.getOperand(1))); if (!isa(SI.getOperand(0)->getType())) return; DSNode *Value = getValueNode(*SI.getOperand(0)); - DSNode *DestPtr = getValueNode(*SI.getOperand(1)); - getSubscriptedNode(SI, DestPtr)->addEdgeTo(getLink(Value, 0)); + DestPtr->addEdgeTo(getLink(Value, 0)); } void GraphBuilder::visitReturnInst(ReturnInst &RI) {