[LIR] Use the more appropriate method. NFC.
authorChad Rosier <mcrosier@codeaurora.org>
Thu, 19 Nov 2015 17:27:28 +0000 (17:27 +0000)
committerChad Rosier <mcrosier@codeaurora.org>
Thu, 19 Nov 2015 17:27:28 +0000 (17:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253578 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopIdiomRecognize.cpp

index c2fb8cd49b7ee53445f991898a4eb984e0dbe30a..e3c84c6e71bbee859d44e865a268ed459236e5b5 100644 (file)
@@ -367,7 +367,7 @@ bool LoopIdiomRecognize::processLoopStore(StoreInst *SI, const SCEV *BECount) {
   //   for (i) A[i] = B[i];
   if (LoadInst *LI = dyn_cast<LoadInst>(StoredVal)) {
     const SCEVAddRecExpr *LoadEv =
-        dyn_cast<SCEVAddRecExpr>(SE->getSCEV(LI->getOperand(0)));
+        dyn_cast<SCEVAddRecExpr>(SE->getSCEV(LI->getPointerOperand()));
     if (LoadEv && LoadEv->getLoop() == CurLoop && LoadEv->isAffine() &&
         StoreEv->getOperand(1) == LoadEv->getOperand(1) && LI->isSimple())
       if (processLoopStoreOfLoopLoad(SI, StoreSize, StoreEv, LoadEv, BECount,