[clang] [CIR]Upstream generic intrinsic emission path (PR #179098)

Priyanshu Kumar via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 1 07:55:48 PST 2026


================
@@ -726,6 +727,108 @@ static RValue tryEmitFPMathIntrinsic(CIRGenFunction &cgf, const CallExpr *e,
   return RValue::getIgnored();
 }
 
+static mlir::Type
+decodeFixedType(ArrayRef<llvm::Intrinsic::IITDescriptor> &infos,
+                mlir::MLIRContext *context) {
+  using namespace llvm::Intrinsic;
+
+  IITDescriptor descriptor = infos.front();
+  infos = infos.slice(1);
+
+  switch (descriptor.Kind) {
+  case IITDescriptor::Void:
+    return cir::VoidType::get(context);
+  case IITDescriptor::Integer:
+    return cir::IntType::get(context, descriptor.Integer_Width,
+                             /*isSigned=*/true);
+  case IITDescriptor::Float:
+    return cir::SingleType::get(context);
+  case IITDescriptor::Double:
+    return cir::DoubleType::get(context);
+  default:
+    llvm_unreachable("NYI");
----------------
Priyanshu3820 wrote:

I had decided not to upstream support for vector and pointer arguments for this PR to avoid it from becoming too much for one PR. I will create a follow-up PR for that.

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


More information about the cfe-commits mailing list