[llvm-commits] [poolalloc] r122437 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp

John Criswell criswell at uiuc.edu
Wed Dec 22 13:11:40 PST 2010


Author: criswell
Date: Wed Dec 22 15:11:40 2010
New Revision: 122437

URL: http://llvm.org/viewvc/llvm-project?rev=122437&view=rev
Log:
Strip pointer casts when determining if a pool handle is a local alloca
instruction.  This gets APA to correctly recognize pools used by run-time
checks.

Modified:
    poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp

Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=122437&r1=122436&r2=122437&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Wed Dec 22 15:11:40 2010
@@ -58,8 +58,7 @@
 
     template <typename InstType, typename SetType>
     void AddPoolUse(InstType &I, Value *PoolHandle, SetType &Set) {
-      // FIXME: Strip away pointer casts
-      if (AllocaInst *AI = dyn_cast<AllocaInst>(PoolHandle))
+      if (AllocaInst *AI=dyn_cast<AllocaInst>(PoolHandle->stripPointerCasts()))
         Set.insert(std::make_pair(AI, &I));
     }
 





More information about the llvm-commits mailing list