[llvm] [RISCV] Adjust select shuffle cost to reflect mask creation cost (PR #77963)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 11:16:48 PST 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 5ce067d592b78fd3142364e06bae4da2a3a1e944 e886bb3556d4058dede441a8f3e80c39249e6f82 -- 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 94c895a58a..41cc081a67 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -445,9 +445,8 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
     // cost for small masks and most shuffles are small.  At worst, this cost
     // should be a very small constant for the constant pool load.  As such,
     // we may bias towards large selects slightly more than truely warranted.
-    return LT.first *
-           (2 + getRISCVInstructionCost({RISCV::VMERGE_VVM},
-                                        LT.second, CostKind));
+    return LT.first * (2 + getRISCVInstructionCost({RISCV::VMERGE_VVM},
+                                                   LT.second, CostKind));
   }
   case TTI::SK_Broadcast: {
     bool HasScalar = (Args.size() > 0) && (Operator::getOpcode(Args[0]) ==

``````````

</details>


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


More information about the llvm-commits mailing list