Fix unused variable warning from r252017
authorAdam Nemet <anemet@apple.com>
Wed, 4 Nov 2015 00:10:33 +0000 (00:10 +0000)
committerAdam Nemet <anemet@apple.com>
Wed, 4 Nov 2015 00:10:33 +0000 (00:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252019 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopLoadElimination.cpp

index 3dc9f84387e894781ab56eae8c19abdc0dc019ca..eb64fbff1d3f27c669a82a06d5a2237cd80001cd 100644 (file)
@@ -59,12 +59,11 @@ struct StoreToLoadForwardingCandidate {
     Value *LoadPtr = Load->getPointerOperand();
     Value *StorePtr = Store->getPointerOperand();
     Type *LoadPtrType = LoadPtr->getType();
-    Type *StorePtrType = StorePtr->getType();
     Type *LoadType = LoadPtrType->getPointerElementType();
 
     assert(LoadPtrType->getPointerAddressSpace() ==
-               StorePtrType->getPointerAddressSpace() &&
-           LoadType == StorePtrType->getPointerElementType() &&
+               StorePtr->getType()->getPointerAddressSpace() &&
+           LoadType == StorePtr->getType()->getPointerElementType() &&
            "Should be a known dependence");
 
     auto &DL = Load->getParent()->getModule()->getDataLayout();