[llvm] [RISCV][TTI] Avoid an infinite recursion issue in getCastInstrCost (PR #110164)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 26 13:08:48 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 d01e336336f2b7fb4137e3dcc7d5c0b06ca1f3d6 293b05fabea8a690ae293ce38754cf418bf4a245 --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 f07209095a..121e68bbd9 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -1184,8 +1184,8 @@ InstructionCost RISCVTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
// vmv.v.i v8, 0
// vmerge.vim v8, v8, -1, v0
return DstLT.first *
- getRISCVInstructionCost({RISCV::VMV_V_I, RISCV::VMERGE_VIM},
- DstLT.second, CostKind) +
+ getRISCVInstructionCost({RISCV::VMV_V_I, RISCV::VMERGE_VIM},
+ DstLT.second, CostKind) +
DstLT.first - 1;
}
break;
@@ -1197,8 +1197,8 @@ InstructionCost RISCVTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
// vand.vi v8, v8, 1
// vmsne.vi v0, v8, 0
return SrcLT.first *
- getRISCVInstructionCost({RISCV::VAND_VI, RISCV::VMSNE_VI},
- SrcLT.second, CostKind) +
+ getRISCVInstructionCost({RISCV::VAND_VI, RISCV::VMSNE_VI},
+ SrcLT.second, CostKind) +
SrcLT.first - 1;
}
break;
``````````
</details>
https://github.com/llvm/llvm-project/pull/110164
More information about the llvm-commits
mailing list