[llvm-commits] [poolalloc] r131736 - /poolalloc/trunk/lib/AssistDS/TypeChecks.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Fri May 20 10:10:36 PDT 2011


Author: aggarwa4
Date: Fri May 20 12:10:36 2011
New Revision: 131736

URL: http://llvm.org/viewvc/llvm-project?rev=131736&view=rev
Log:
If it is a copying load, the target and the src
pointers are not the same DSNode, they point to the
same DSNode, for which metadata is needed. Initialize
the metadata to be the type of the load/store. This 
should be correct, as all access were typesafe 
till now, as per the typesafe src pointer node.

Modified:
    poolalloc/trunk/lib/AssistDS/TypeChecks.cpp

Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=131736&r1=131735&r2=131736&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Fri May 20 12:10:36 2011
@@ -1115,6 +1115,19 @@
   CastInst *BCI_Dest = BitCastInst::CreatePointerCast(SI.getPointerOperand(), VoidPtrTy, "", &SI);
   CastInst *BCI_Src = BitCastInst::CreatePointerCast(SS, VoidPtrTy, "", &SI);
 
+  if(EnableTypeSafeOpt) {
+    LoadInst *LI = cast<LoadInst>(SI.getOperand(0));
+    if(TS->isTypeSafe(LI->getPointerOperand(), SI.getParent()->getParent())) {
+      std::vector<Value *> Args;
+      Args.push_back(BCI_Src);
+      Args.push_back(ConstantInt::get(Int8Ty, UsedTypes[SI.getOperand(0)->getType()])); // SI.getValueOperand()
+      Args.push_back(ConstantInt::get(Int64Ty, TD->getTypeStoreSize(SI.getOperand(0)->getType())));
+      Args.push_back(ConstantInt::get(Int32Ty, tagCounter++));
+      Constant *F = M.getOrInsertFunction("trackStoreInst", VoidTy, VoidPtrTy, Int8Ty, Int64Ty, Int32Ty, NULL);
+      CallInst::Create(F, Args.begin(), Args.end(), "", &SI);
+    }
+  }
+
   std::vector<Value *> Args;
   Args.push_back(BCI_Dest);
   Args.push_back(BCI_Src);





More information about the llvm-commits mailing list