[llvm] Bf16 select (PR #224218)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 00:48:16 PDT 2026


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 origin/main HEAD --extensions cpp -- llvm/lib/Target/X86/X86ISelLowering.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 2fb96ca01..1d22db47c 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -49016,13 +49016,15 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG,
       // Current blend in v8i16 (not v8f16) sincea v8f16
       // VSELECT can fail to select on subtargets that fall back to
       // BLENDV(since there's no VBLENDVPH) instead of a mask-register select.
-      SDValue Mask = DAG.getNode(ISD::SUB, DL, MVT::i16,
-                                 DAG.getConstant(0, DL, MVT::i16),
-                                 DAG.getZExtOrTrunc(Cond, DL, MVT::i16));
-      SDValue VLHS = DAG.getBitcast(
-          MVT::v8i16, DAG.getNode(ISD::SCALAR_TO_VECTOR, DL, MVT::v8f16, F16LHS));
-      SDValue VRHS = DAG.getBitcast(
-          MVT::v8i16, DAG.getNode(ISD::SCALAR_TO_VECTOR, DL, MVT::v8f16, F16RHS));
+      SDValue Mask =
+          DAG.getNode(ISD::SUB, DL, MVT::i16, DAG.getConstant(0, DL, MVT::i16),
+                      DAG.getZExtOrTrunc(Cond, DL, MVT::i16));
+      SDValue VLHS =
+          DAG.getBitcast(MVT::v8i16, DAG.getNode(ISD::SCALAR_TO_VECTOR, DL,
+                                                 MVT::v8f16, F16LHS));
+      SDValue VRHS =
+          DAG.getBitcast(MVT::v8i16, DAG.getNode(ISD::SCALAR_TO_VECTOR, DL,
+                                                 MVT::v8f16, F16RHS));
       SDValue VMask = DAG.getNode(ISD::SCALAR_TO_VECTOR, DL, MVT::v8i16, Mask);
       SDValue VSel = DAG.getSelect(DL, MVT::v8i16, VMask, VLHS, VRHS);
       SDValue Res = DAG.getExtractVectorElt(DL, MVT::i16, VSel, 0);

``````````

</details>


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


More information about the llvm-commits mailing list