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

Arushi Aggarwal aggarwa4 at illinois.edu
Fri Jun 24 08:04:00 PDT 2011


Author: aggarwa4
Date: Fri Jun 24 10:04:00 2011
New Revision: 133795

URL: http://llvm.org/viewvc/llvm-project?rev=133795&view=rev
Log:
Instead of visiting all calls to checkType, only
visit the ones using the same metadata value.

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=133795&r1=133794&r2=133795&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Fri Jun 24 10:04:00 2011
@@ -501,11 +501,11 @@
         if(CI->getCalledFunction() != checkTypeInst)
           continue;
         std::list<Instruction *>toDelete;
-        for(Value::use_iterator User = checkTypeInst->use_begin(); User != checkTypeInst->use_end(); ++User) {
+        for(Value::use_iterator User = CI->getOperand(3)->use_begin(); User != CI->getOperand(3)->use_end(); ++User) {
           CallInst *CI2 = dyn_cast<CallInst>(User);
-          if(CI2 == CI)
+          if(!CI2)
             continue;
-          if(CI2->getParent()->getParent() != &F)
+          if(CI2 == CI)
             continue;
           // Check that they are refering to the same pointer
           if(CI->getOperand(4) != CI2->getOperand(4))
@@ -513,9 +513,9 @@
           // Check that they are using the same metadata for comparison.
           if(CI->getOperand(3) != CI2->getOperand(3))
             continue;
-          // if CI, dominates CI2, delete CI2
           if(!DT.dominates(CI, CI2))
             continue;
+          // if CI, dominates CI2, delete CI2
           toDelete.push_back(CI2);
         }
         while(!toDelete.empty()) {





More information about the llvm-commits mailing list