[clang] [Clang] Move hlsl_wave_get_lane_index to EmitHLSLBuiltinExpr (PR #87131)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 29 18:01:20 PDT 2024


================
@@ -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 RValue::get(CI);
----------------
farzonl wrote:

Please build the project and run the hlsl lit tests 

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


More information about the cfe-commits mailing list