[llvm] [RISCV][TTI] Reduce cost of a <N x i1> build_vector pattern (PR #109449)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 10:49:24 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 f7c3309b1361443cded697255995fade24838ef8 bdd4441e59ad4416e55eefafd48ed20ace64d9ed --extensions cpp -- llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
index e6a27e0613..f0d45b078d 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -640,11 +640,11 @@ InstructionCost RISCVTTIImpl::getScalarizationOverhead(
       auto *WideVecTy = cast<VectorType>(Ty->getWithNewBitWidth(8));
       // Note: Implicit scalar anyextend is assumed to be free since the i1
       // must be stored in a GPR.
-      InstructionCost BVCost =
-        getScalarizationOverhead(WideVecTy, DemandedElts, Insert, Extract, CostKind);
+      InstructionCost BVCost = getScalarizationOverhead(
+          WideVecTy, DemandedElts, Insert, Extract, CostKind);
       InstructionCost TruncCost =
-        getCastInstrCost(Instruction::Trunc, Ty, WideVecTy, TTI::CastContextHint::None,
-                         CostKind, nullptr);
+          getCastInstrCost(Instruction::Trunc, Ty, WideVecTy,
+                           TTI::CastContextHint::None, CostKind, nullptr);
       return BVCost + TruncCost;
     }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/109449


More information about the llvm-commits mailing list