[PATCH] D116688: [SLP]Excluded external uses from the reordering estimation.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 10:17:20 PST 2022


ABataev marked an inline comment as done.
ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1364
           Value *OpRight = (LeftToRight) ? Op : OpLastLane;
-          unsigned Score =
-              getLookAheadScore({OpLeft, LastLane}, {OpRight, Lane});
-          if (Score > BestOp.Score) {
+          int Score = getLookAheadScore(OpLeft, OpRight, MainAltOps);
+          if (Score) {
----------------
vporpo wrote:
> Since the score calculation is a bit more complicated now, I think it makes sense to move all the score calculation logic into a separate function like `getScore()` which will help hide all the calls to the separate score functions `getLookAheadScore()`, `getSplatScore()`, `getExternalScore()` and the score scaling. What do you think?
I would keep all these smaller functions but will create `getScore()` for a final score.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1378
+              // operand with all vectorized uses.
+              Score *= 10;
+              Score += getExternalUseScore(Lane, OpIdx, Idx);
----------------
vporpo wrote:
> nit: use a static constexpr for the scaling factor
Yep, will fix it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116688



More information about the llvm-commits mailing list