[PATCH] D124202: [SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmeticInstrCost`

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 02:39:28 PDT 2022


dmgreen added a comment.

I committed the new tests I had under rG091c2f953dd6 <https://reviews.llvm.org/rG091c2f953dd6328fd6dd0722a4a8ba47902a65bb>, if you don't mind rebasing.



================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:2607
+      bool IsLoad =
+          llvm::any_of(Args, [](const auto *V) { return isa<LoadInst>(V); });
       if (IsLoad && isLegalBroadcastLoad(Tp->getElementType(),
----------------
I think I would go for `Args.size() > 0 && isa<LoadInst>(Args[0])`. The second operand may be undef, but a broadcast is going to be coming from the first operand for any shuffle close to canonical.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124202



More information about the llvm-commits mailing list