[PATCH] D121354: [SLP] Fix lookahead operand reordering for splat loads.

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 09:54:21 PDT 2022


vporpo added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfo.h:1049
+  InstructionCost getBroadcastLoadCost(Type *ElementTy,
+                                       unsigned NumElements) const;
+
----------------
RKSimon wrote:
> Why do we need this? Why not just use getShuffleCost?
We could use `getShuffleCost()` instead and introduce a new enumerator like `ShuffleKind::SK_BroadcastLoad`. 
But I feel it is better to use a separate function because `getShuffleCost()` is all about the cost of data shuffling (broadcast, reverse, select, transpose etc.), while a BroadcastLoad includes both a load from memory and a data shuffle. I don't have a strong preference though, what do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121354



More information about the llvm-commits mailing list