Fix an obvious typo that causes an assertion failure when running
authorDuncan Sands <baldrick@free.fr>
Fri, 2 Nov 2012 07:49:32 +0000 (07:49 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 2 Nov 2012 07:49:32 +0000 (07:49 +0000)
test/Transforms/GVN/rle.ll if the (currently disabled) check for a
pointer type in getIntPtrType is turned on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167285 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GVN.cpp

index f10b71d33e08d498d949c07fa5c702cc3227fd45..f003e0669966b9780dd23d78b7d3ae8646b28532 100644 (file)
@@ -780,7 +780,7 @@ static Value *CoerceAvailableValueToLoadType(Value *StoredVal,
 
     Type *TypeToCastTo = LoadedTy;
     if (TypeToCastTo->getScalarType()->isPointerTy())
-      TypeToCastTo = TD.getIntPtrType(StoredValTy);
+      TypeToCastTo = TD.getIntPtrType(TypeToCastTo);
 
     if (StoredValTy != TypeToCastTo)
       StoredVal = new BitCastInst(StoredVal, TypeToCastTo, "", InsertPt);