https://github.com/marcauberer updated https://github.com/llvm/llvm-project/pull/87131
>From 283fe4ea57765077bc9453adeec66ce8832c68c3 Mon Sep 17 00:00:00 2001 From: Marc Auberer <marc.aube...@chillibits.com> Date: Sat, 30 Mar 2024 01:52:52 +0100 Subject: [PATCH] [Clang] Move hlsl_wave_get_lane_index to EmitHLSLBuiltinExpr --- clang/lib/CodeGen/CGBuiltin.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 287e763bad82dd..bb007231c0b783 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -5892,16 +5892,6 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, Name), {NDRange, Kernel, Block})); } - - case Builtin::BI__builtin_hlsl_wave_get_lane_index: { - auto *CI = EmitRuntimeCall(CGM.CreateRuntimeFunction( - llvm::FunctionType::get(IntTy, {}, false), "__hlsl_wave_get_lane_index", - {}, false, true)); - if (getTarget().getTriple().isSPIRVLogical()) - CI = dyn_cast<CallInst>(addControlledConvergenceToken(CI)); - return RValue::get(CI); - } - case Builtin::BI__builtin_store_half: case Builtin::BI__builtin_store_halff: { Value *Val = EmitScalarExpr(E->getArg(0)); @@ -18317,6 +18307,14 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, /*ReturnType=*/Op0->getType(), Intrinsic::dx_rsqrt, ArrayRef<Value *>{Op0}, nullptr, "dx.rsqrt"); } + case Builtin::BI__builtin_hlsl_wave_get_lane_index: { + auto *CI = EmitRuntimeCall(CGM.CreateRuntimeFunction( + llvm::FunctionType::get(IntTy, {}, false), "__hlsl_wave_get_lane_index", + {}, false, true)); + if (getTarget().getTriple().isSPIRVLogical()) + CI = dyn_cast<CallInst>(addControlledConvergenceToken(CI)); + return CI; + } } return nullptr; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits