[llvm] [SLP] Compute a shuffle mask for SK_Broadcast shuffle (PR #85327)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 14 15:56:58 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 33960c90258ed78b9b877b1a43e219d1cbc2efce 6734e37e873263eecd9b2f871f1c4a0cbda85f06 -- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 885015df1f..25962abb03 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -7750,16 +7750,15 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis {
PoisonValue::get(VecTy), *It);
SmallVector<int> ShuffleMask(VL.size(), -1);
- transform(VL, ShuffleMask.begin(), [](Value *V) {
- return !isa<UndefValue>(V);
- });
- InstructionCost InsertCost = TTI.getVectorInstrCost(
- Instruction::InsertElement, VecTy, CostKind, 0,
- PoisonValue::get(VecTy), *It);
- return InsertCost +
- TTI.getShuffleCost(TargetTransformInfo::SK_Broadcast, VecTy,
- ShuffleMask, CostKind, /*Index=*/0,
- /*SubTp=*/nullptr, /*Args=*/*It);
+ transform(VL, ShuffleMask.begin(),
+ [](Value *V) { return !isa<UndefValue>(V); });
+ InstructionCost InsertCost =
+ TTI.getVectorInstrCost(Instruction::InsertElement, VecTy, CostKind, 0,
+ PoisonValue::get(VecTy), *It);
+ return InsertCost + TTI.getShuffleCost(TargetTransformInfo::SK_Broadcast,
+ VecTy, ShuffleMask, CostKind,
+ /*Index=*/0,
+ /*SubTp=*/nullptr, /*Args=*/*It);
}
return GatherCost +
(all_of(Gathers, UndefValue::classof)
``````````
</details>
https://github.com/llvm/llvm-project/pull/85327
More information about the llvm-commits
mailing list