[llvm] [LV] Teach the vectorizer to cost and vectorize llvm.sincos intrinsics (PR #123210)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 16 06:43:58 PST 2025
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 c1de9b920935e7d2fcc8dd7b39c1b7285783e948 0dbf0e84c4c2beda12a38fe2dff5e35710ea8265 --extensions h,cpp -- llvm/include/llvm/Analysis/TargetTransformInfo.h llvm/include/llvm/CodeGen/BasicTTIImpl.h llvm/lib/Analysis/TargetTransformInfo.cpp llvm/lib/Analysis/VectorUtils.cpp llvm/lib/Transforms/Vectorize/LoopVectorize.cpp llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index ca9e7359c0..e26e3f9c65 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -1718,8 +1718,8 @@ public:
Type *RetTy = ICA.getReturnType();
- ElementCount RetVF =
- isVectorizedTy(RetTy) ? getVectorizedTypeVF(RetTy) : ElementCount::getFixed(1);
+ ElementCount RetVF = isVectorizedTy(RetTy) ? getVectorizedTypeVF(RetTy)
+ : ElementCount::getFixed(1);
const IntrinsicInst *I = ICA.getInst();
const SmallVectorImpl<const Value *> &Args = ICA.getArgs();
@@ -1999,18 +1999,20 @@ public:
break;
// Cost the call + mask.
- auto Cost = thisT()->getCallInstrCost(nullptr, RetTy, ICA.getArgTypes(), CostKind);
+ auto Cost = thisT()->getCallInstrCost(nullptr, RetTy, ICA.getArgTypes(),
+ CostKind);
if (VD->isMasked())
- Cost += thisT()->getShuffleCost(TargetTransformInfo::SK_Broadcast,
- VectorType::get(IntegerType::getInt1Ty(Ctx), VF),
- {}, CostKind, 0, nullptr, {});
+ Cost += thisT()->getShuffleCost(
+ TargetTransformInfo::SK_Broadcast,
+ VectorType::get(IntegerType::getInt1Ty(Ctx), VF), {}, CostKind, 0,
+ nullptr, {});
// Lowering to a sincos library call (with output pointers) may require us
// to emit reloads for the results.
Cost +=
- thisT()->getMemoryOpCost(Instruction::Load, VectorTy,
- thisT()->getDataLayout().getABITypeAlign(VectorTy), 0,
- CostKind) *
+ thisT()->getMemoryOpCost(
+ Instruction::Load, VectorTy,
+ thisT()->getDataLayout().getABITypeAlign(VectorTy), 0, CostKind) *
2;
return Cost;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/123210
More information about the llvm-commits
mailing list