[llvm] [ConstantTime][LLVM] Add llvm.ct.select intrinsic with generic SelectionDAG lowering (PR #166702)

Julius Alexandre via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 06:53:32 PDT 2026


================
@@ -4352,6 +4353,188 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
     }
     Results.push_back(Tmp1);
     break;
+  case ISD::CT_SELECT: {
+    // Constant-time select: F ^ ((T ^ F) & Mask), Mask = 0 - (cond & 1).
----------------
wizardengineer wrote:

Moved to `SelectionDAGLegalize::ExpandCTSELECT`. Pure code motion, the emitted asm is unchanged for every RUN line of the existing tests.

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


More information about the llvm-commits mailing list