[EarlyCSE] Address post commit review for r249523.
[oota-llvm.git] / lib / Transforms / Scalar / LoopIdiomRecognize.cpp
index b87af7cde519045c97092a79a4af6dcf109dce9e..f5b61edd5cc47c8cdcc0c0b5553352b485939f3d 100644 (file)
@@ -531,7 +531,7 @@ bool LoopIdiomRecognize::processLoopStridedStore(
   BECount = SE->getTruncateOrZeroExtend(BECount, IntPtr);
 
   const SCEV *NumBytesS =
-      SE->getAddExpr(BECount, SE->getConstant(IntPtr, 1), SCEV::FlagNUW);
+      SE->getAddExpr(BECount, SE->getOne(IntPtr), SCEV::FlagNUW);
   if (StoreSize != 1) {
     NumBytesS = SE->getMulExpr(NumBytesS, SE->getConstant(IntPtr, StoreSize),
                                SCEV::FlagNUW);
@@ -635,7 +635,7 @@ bool LoopIdiomRecognize::processLoopStoreOfLoopLoad(
   BECount = SE->getTruncateOrZeroExtend(BECount, IntPtrTy);
 
   const SCEV *NumBytesS =
-      SE->getAddExpr(BECount, SE->getConstant(IntPtrTy, 1), SCEV::FlagNUW);
+      SE->getAddExpr(BECount, SE->getOne(IntPtrTy), SCEV::FlagNUW);
   if (StoreSize != 1)
     NumBytesS = SE->getMulExpr(NumBytesS, SE->getConstant(IntPtrTy, StoreSize),
                                SCEV::FlagNUW);