[SCEV] Add and use SCEVConstant::getAPInt; NFCI
[oota-llvm.git] / lib / Transforms / Scalar / LoopIdiomRecognize.cpp
index b2cc66852d5db1a1e3de7609b6c8b230f9954eac..5a92d3198af796a750cfedff9d9994fdd6a1ff47 100644 (file)
@@ -222,7 +222,7 @@ bool LoopIdiomRecognize::runOnCountableLoop() {
   // If this loop executes exactly one time, then it should be peeled, not
   // optimized by this pass.
   if (const SCEVConstant *BECst = dyn_cast<SCEVConstant>(BECount))
-    if (BECst->getValue()->getValue() == 0)
+    if (BECst->getAPInt() == 0)
       return false;
 
   SmallVector<BasicBlock *, 8> ExitBlocks;
@@ -253,7 +253,7 @@ static unsigned getStoreSizeInBytes(StoreInst *SI, const DataLayout *DL) {
 
 static unsigned getStoreStride(const SCEVAddRecExpr *StoreEv) {
   const SCEVConstant *ConstStride = cast<SCEVConstant>(StoreEv->getOperand(1));
-  return ConstStride->getValue()->getValue().getZExtValue();
+  return ConstStride->getAPInt().getZExtValue();
 }
 
 bool LoopIdiomRecognize::isLegalStore(StoreInst *SI) {