[PATCH] D144770: [SLP] Outline GEP chain cost modeling into new TTI interface - NFCI.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 04:13:43 PST 2023


ABataev added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfo.h:280-287
+    /// All the GEPs in a set have same base address.
+    bool IsSameBaseAddress = false;
+
+    /// These properties only valid if SameBaseAddress is set.
+    /// True if distance between any two neigbouring pointers is same value.
+    bool IsUniformStride = false;
+    /// True if distance between any two neigbouring pointers is a known value.
----------------
Better to represent them as bitfields:
```
bool IsSameBaseAddress:1 = false;
bool IsUniformStride:1 = false;
bool IsKnownStride:1 = false;
unsigned Reserved: 29; 
```


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2815-2824
+                     InstructionCost VecCost, InstructionCost ScalarCost,
+                     StringRef Banner) const {
+    dbgs() << "SLP: " << Banner << ":\n";
+    E->dump();
     dbgs() << "SLP: Costs:\n";
     dbgs() << "SLP:     ReuseShuffleCost = " << ReuseShuffleCost << "\n";
     dbgs() << "SLP:     VectorCost = " << VecCost << "\n";
----------------
This change may be committed separately


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7183
+        // rather than just single use.
+        if (Ptr && !Ptr->hasOneUse())
+          MultipleUseGEPs.push_back(V);
----------------
Use areAllUsersVectorized?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144770/new/

https://reviews.llvm.org/D144770



More information about the llvm-commits mailing list