Calculate mod/ref info
authorChris Lattner <sabre@nondot.org>
Thu, 17 Oct 2002 22:13:19 +0000 (22:13 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 17 Oct 2002 22:13:19 +0000 (22:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4223 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/Local.cpp

index 5020cf982fb64625649bb732f9800a9841e61c19..43fd5a4a5449d78667950c8256783a16da08cab7 100644 (file)
@@ -328,12 +328,15 @@ void GraphBuilder::visitGetElementPtrInst(GetElementPtrInst &GEP) {
 
 void GraphBuilder::visitLoadInst(LoadInst &LI) {
   DSNodeHandle &Ptr = getValueDest(*LI.getOperand(0));
+  Ptr.getNode()->NodeType |= DSNode::Read;
+  
   if (isPointerType(LI.getType()))
     getValueNode(LI).addEdgeTo(getLink(Ptr, 0, LI.getType()));
 }
 
 void GraphBuilder::visitStoreInst(StoreInst &SI) {
   DSNodeHandle &Dest = getValueDest(*SI.getOperand(1));
+  Dest.getNode()->NodeType |= DSNode::Modified;
 
   // Avoid adding edges from null, or processing non-"pointer" stores
   if (isPointerType(SI.getOperand(0)->getType()) &&