[PATCH] D27518: Moving isComplex decision to TTI

Elena Demikhovsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 00:20:18 PST 2016


delena added inline comments.


================
Comment at: include/llvm/Analysis/TargetTransformInfo.h:609
+  struct AddressAccessInfo {
+    bool  isStrided;        /// True in case the access is strided (AddRec).
+                            /// False otherwise.
----------------
Please add a cosntructor here.


================
Comment at: include/llvm/Analysis/TargetTransformInfo.h:613
+    bool isStridedAccess() const { return isStrided; } 
+    bool isConstantStridedAccess() const {
+      if (!isStrided || !Step)
----------------
I suggest to shorten these 2 functions:
 bool isConstantStridedAccess() const {
     return (!Strided || !dyn_cast<SCEVConstant>(Step));
  }


 bool isConstantStridedAccessLessThan(int64_t MergeDistance) const {
      if (!isConstantStridedAccess())
        return false;
      APInt StrideVal = cast<SCEVConstant>(C)->getAPInt();
      if (StrideVal.getBitWidth() > 64)
        return false;
      return StrideVal.getSExtValue() < MergeDistance;
    }


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:6788
+  TargetTransformInfo::AddressAccessInfo AddressInfo;
+  AddressInfo.isStrided = false;
+  AddressInfo.Step = nullptr;
----------------
These 2 lines may be removed once you have a constructor.


https://reviews.llvm.org/D27518





More information about the llvm-commits mailing list