[llvm] r189853 - Use type form of getIntPtrType in alloca visitor.

Matt Arsenault Matthew.Arsenault at amd.com
Tue Sep 3 14:05:15 PDT 2013


Author: arsenm
Date: Tue Sep  3 16:05:15 2013
New Revision: 189853

URL: http://llvm.org/viewvc/llvm-project?rev=189853&view=rev
Log:
Use type form of getIntPtrType in alloca visitor.

This doesn't actually matter, since alloca is always
0 address space, but this is more consistent.

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=189853&r1=189852&r2=189853&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Tue Sep  3 16:05:15 2013
@@ -154,7 +154,7 @@ Instruction *InstCombiner::visitAllocaIn
   // Ensure that the alloca array size argument has type intptr_t, so that
   // any casting is exposed early.
   if (TD) {
-    Type *IntPtrTy = TD->getIntPtrType(AI.getContext());
+    Type *IntPtrTy = TD->getIntPtrType(AI.getType());
     if (AI.getArraySize()->getType() != IntPtrTy) {
       Value *V = Builder->CreateIntCast(AI.getArraySize(),
                                         IntPtrTy, false);
@@ -181,7 +181,7 @@ Instruction *InstCombiner::visitAllocaIn
       // insert our getelementptr instruction...
       //
       Type *IdxTy = TD
-                  ? TD->getIntPtrType(AI.getContext())
+                  ? TD->getIntPtrType(AI.getType())
                   : Type::getInt64Ty(AI.getContext());
       Value *NullIdx = Constant::getNullValue(IdxTy);
       Value *Idx[2] = { NullIdx, NullIdx };





More information about the llvm-commits mailing list