]> granicus.if.org Git - llvm/commitdiff
[LoopIdioms] More LocationSize::precise annotations; NFC
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Mon, 24 Dec 2018 05:55:50 +0000 (05:55 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Mon, 24 Dec 2018 05:55:50 +0000 (05:55 +0000)
Both of these places reference memset-like loops. Memset is precise.

Trying to keep these patches super small so they're easily post-commit
verifiable, as requested in D44748.

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

lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
lib/Transforms/Scalar/LoopIdiomRecognize.cpp

index 702d68fad9bf0832065298ef84a63787f17058b4..985f41f3a7d96837ea013a834e5dc992e6374dbc 100644 (file)
@@ -1975,7 +1975,8 @@ mayLoopAccessLocation(Value *Ptr, ModRefInfo Access, Loop *L,
   // If the loop iterates a fixed number of times, we can refine the access
   // size to be exactly the size of the memset, which is (BECount+1)*StoreSize
   if (const SCEVConstant *BECst = dyn_cast<SCEVConstant>(BECount))
-    AccessSize = (BECst->getValue()->getZExtValue() + 1) * StoreSize;
+    AccessSize = LocationSize::precise((BECst->getValue()->getZExtValue() + 1) *
+                                       StoreSize);
 
   // TODO: For this to be really effective, we have to dive into the pointer
   // operand in the store.  Store to &A[i] of 100 will always return may alias
index 241dbed30e1b7af32c524571061d70def9ed8a53..a52235ae5d4ca161133d2d11ec09f122766678ab 100644 (file)
@@ -779,12 +779,13 @@ mayLoopAccessLocation(Value *Ptr, ModRefInfo Access, Loop *L,
   // Get the location that may be stored across the loop.  Since the access is
   // strided positively through memory, we say that the modified location starts
   // at the pointer and has infinite size.
-  uint64_t AccessSize = MemoryLocation::UnknownSize;
+  LocationSize AccessSize = LocationSize::unknown();
 
   // If the loop iterates a fixed number of times, we can refine the access size
   // to be exactly the size of the memset, which is (BECount+1)*StoreSize
   if (const SCEVConstant *BECst = dyn_cast<SCEVConstant>(BECount))
-    AccessSize = (BECst->getValue()->getZExtValue() + 1) * StoreSize;
+    AccessSize = LocationSize::precise((BECst->getValue()->getZExtValue() + 1) *
+                                       StoreSize);
 
   // TODO: For this to be really effective, we have to dive into the pointer
   // operand in the store.  Store to &A[i] of 100 will always return may alias