[clang] [CIR][AMDGPU] Add support for AMDGCN log builtins (PR #198032)

Rana Pratap Reddy via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 19 00:15:47 PDT 2026


================
@@ -276,10 +265,10 @@ CIRGenFunction::emitAMDGPUBuiltinExpr(unsigned builtinId,
   }
   case AMDGPU::BI__builtin_amdgcn_logf:
   case AMDGPU::BI__builtin_amdgcn_log_bf16: {
-    cgm.errorNYI(expr->getSourceRange(),
-                 std::string("unimplemented AMDGPU builtin call: ") +
-                     getContext().BuiltinInfo.getName(builtinId));
-    return mlir::Value{};
+    mlir::Value src = emitScalarExpr(expr->getArg(0));
+    return builder.emitIntrinsicCallOp(getLoc(expr->getExprLoc()),
+                                       "amdgcn.log", src.getType(),
+                                       mlir::ValueRange{src});
----------------
ranapratap55 wrote:

Since several open CIR AMDGPU builtin PRs share the same pattern, it may be worth adding a small CIR-side equivalent helper and routing these cases through it. So, the CIR structure mirrors the existing CodeGen path and reduces repeated code.

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


More information about the cfe-commits mailing list