[clang] [CIR] Add opt-in flag to run x86_64 call-conv lowering (PR #211335)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 22 13:58:04 PDT 2026


================
@@ -49,6 +60,19 @@ runCIRToCIRPasses(mlir::ModuleOp theModule, mlir::MLIRContext &mlirContext,
 
   pm.addPass(mlir::createTargetLoweringPass());
   pm.addPass(mlir::createCXXABILoweringPass());
+
+  if (enableCallConvLowering) {
+    // CallConvLowering rewrites signatures and call sites using the classifier,
+    // so it must run after CXXABILowering has lowered C++ ABI types to plain
+    // records the classifier can handle.  Only the x86_64 System V classifier
+    // is implemented; other targets are left unchanged.
+    CallConvTarget target =
+        getCallConvTarget(astContext.getTargetInfo().getTriple());
+    if (target != CallConvTarget::None)
+      pm.addPass(mlir::createCallConvLoweringPass(
----------------
andykaylor wrote:

It's just a nice-to-have, but we'll need to discuss how to handle unimplemented targets when this is on by default.

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


More information about the cfe-commits mailing list