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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 6 13:42:20 PST 2025


================
@@ -6674,6 +6773,38 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
     updateDAGForMaybeTailCall(MC);
     return;
   }
+  case Intrinsic::ct_select: {
+    // Set function attribute to indicate ct.select usage
+    Function &F = DAG.getMachineFunction().getFunction();
+    F.addFnAttr("ct-select");
----------------
topperc wrote:

Seems a little weird for SelectionDAGBuilder to be modifying the IR function.

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


More information about the llvm-commits mailing list