[llvm] Add SPIRV lowering for intrinsics @llvm.fptosi.sat.* and @llvm.fptoui.sat.* (PR #125805)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 4 22:11:34 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 d5a2638ae98746d9382231a0f04b11a5415b5e8e 992bcb40e7832df28c697af867b257f83a99c362 --extensions cpp -- llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp b/llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
index 4ef8388efb..694d584c26 100644
--- a/llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
@@ -236,7 +236,6 @@ SPIRVLegalizerInfo::SPIRVLegalizerInfo(const SPIRVSubtarget &ST) {
.legalForCartesianProduct(allIntScalarsAndVectors,
allFloatScalarsAndVectors);
-
getActionDefinitionsBuilder({G_FPTOSI_SAT, G_FPTOUI_SAT})
.legalForCartesianProduct(allIntScalarsAndVectors,
allFloatScalarsAndVectors);
diff --git a/llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp b/llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
index 12f2995656..e2727582c7 100644
--- a/llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
@@ -500,7 +500,8 @@ bool SPIRVPrepareFunctions::substituteIntrinsicCalls(Function *F) {
case Intrinsic::fptosi_sat:
case Intrinsic::fptoui_sat:
ToErase = lowerFPTOISat(II);
- if (ToErase.empty()) break;
+ if (ToErase.empty())
+ break;
Changed = true;
break;
``````````
</details>
https://github.com/llvm/llvm-project/pull/125805
More information about the llvm-commits
mailing list