[llvm-branch-commits] [clang] [llvm] [ConstantTime][RISCV] Add comprehensive tests for ct.select (PR #166708)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Mar 7 13:16:20 PST 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/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.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/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 74446c874..90bb07219 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -4380,7 +4380,7 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
           DAG.getNode(ISD::AND, dl, VT, Cond, DAG.getConstant(1, dl, VT)));
       SDValue Diff = DAG.getNode(ISD::XOR, dl, VT, Tmp2, Tmp3);
       Tmp1 = DAG.getNode(ISD::XOR, dl, VT, Tmp3,
-                          DAG.getNode(ISD::AND, dl, VT, Diff, Mask));
+                         DAG.getNode(ISD::AND, dl, VT, Diff, Mask));
       Tmp1->setFlags(Node->getFlags());
     }
     Results.push_back(Tmp1);
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index d9ceacc7c..c52c47dc2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -6879,10 +6879,9 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
     // the inline fallback which runs before type legalization.
     bool CreateNode =
         TLI.isOperationLegalOrCustom(ISD::CT_SELECT, VT) ||
-        (!VT.isVector() &&
-         (!VT.isFloatingPoint() ||
-          TLI.isTypeLegal(
-              EVT::getIntegerVT(*DAG.getContext(), VT.getSizeInBits()))));
+        (!VT.isVector() && (!VT.isFloatingPoint() ||
+                            TLI.isTypeLegal(EVT::getIntegerVT(
+                                *DAG.getContext(), VT.getSizeInBits()))));
 
     if (CreateNode) {
       SDValue Result = DAG.getNode(ISD::CT_SELECT, DL, VT, Cond, A, B);

``````````

</details>


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


More information about the llvm-branch-commits mailing list