[llvm] Redesign Straight-Line Strength Reduction (SLSR) (PR #162930)

Fei Peng via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 17 14:22:37 PDT 2025


================
@@ -177,22 +203,154 @@ class StraightLineStrengthReduce {
     // Points to the immediate basis of this candidate, or nullptr if we cannot
     // find any basis for this candidate.
     Candidate *Basis = nullptr;
+
+    DKind DeltaKind = InvalidDelta;
+
+    // Store SCEV of Stride to compute delta from different strides
+    const SCEV *StrideSCEV = nullptr;
+
+    // Points to (Y - X) that will be used to rewrite this candidate.
+    Value *Delta = nullptr;
+
+    /// Cost model: Evaluate the computational efficiency of the candidate.
+    ///
+    /// Efficiency levels (higher is better):
----------------
fiigii wrote:

Good idea. Done

https://github.com/llvm/llvm-project/pull/162930


More information about the llvm-commits mailing list