[clang] [CIR][AMDGPU] Add support for AMDGCN trig_preop builtins (PR #197399)
Ayokunle Amodu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 17 09:07:45 PDT 2026
================
@@ -118,6 +118,16 @@ static mlir::Value emitLogbBuiltin(CIRGenFunction &cgf, const CallExpr *e,
return res;
}
+// Emit an intrinsic that has 1 float or double operand, and 1 integer.
+static mlir::Value emitFPIntBuiltin(CIRGenFunction &cgf, const CallExpr *e,
+ llvm::StringRef intrinsicName) {
+ mlir::Value src0 = cgf.emitScalarExpr(e->getArg(0));
+ mlir::Value src1 = cgf.emitScalarExpr(e->getArg(1));
+ return cgf.getBuilder().emitIntrinsicCallOp(
+ cgf.getLoc(e->getExprLoc()), "amdgcn.ds.swizzle", src0.getType(),
----------------
ayokunle321 wrote:
Thanks for the catch!
I mirrored OG but I was wondering if there was even a point of this function given `emitBuiltinWithOneOverloadedType<2>(expr, intrinsicName).getValue()` would give the same result. They both use src0.getType() as the result type.
https://github.com/llvm/llvm-project/pull/197399
More information about the cfe-commits
mailing list