================ @@ -18695,6 +18695,50 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: { CGM.getHLSLRuntime().getSaturateIntrinsic(), ArrayRef<Value *>{Op0}, nullptr, "hlsl.saturate"); } + case Builtin::BI__builtin_hlsl_select: { + Value *OpCond = EmitScalarExpr(E->getArg(0)); + Value *OpTrue = EmitScalarExpr(E->getArg(1)); + Value *OpFalse = EmitScalarExpr(E->getArg(2)); + llvm::Type *TCond = OpCond->getType(); + + // if cond is a bool emit a select instruction + if (TCond->isIntegerTy(1)) + return Builder.CreateSelect(OpCond, OpTrue, OpFalse, "hlsl.select"); + + // if cond is a vector of bools lower to a shufflevector + // todo check if that true and false are vectors ---------------- spall wrote:
I likely just forgot to remove them; because yes they were for my own bookkeeping. https://github.com/llvm/llvm-project/pull/107129 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits