[clang] [CIR] Add x86_64 scalar calling-convention lowering (PR #209636)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 17 08:51:56 PDT 2026


================
@@ -55,6 +60,156 @@ namespace mlir {
 
 namespace {
 
+//===----------------------------------------------------------------------===//
+// x86_64 System V classifier bridge (scalar types)
+//
+// Maps scalar CIR types to llvm::abi::Type, runs the LLVM ABI Lowering
+// Library's SysV x86_64 classifier, and converts the result back into the
+// dialect-agnostic mlir::abi::FunctionClassification that CIRABIRewriteContext
+// consumes.  Only integer / pointer / bool / f32 / f64 signatures are handled;
+// aggregates and other leaf types are reported NYI by classifyX86_64 so an
+// unsupported signature fails the pass instead of being misclassified.
+//===----------------------------------------------------------------------===//
+
+/// llvm::Align requires a power of two; DataLayout can report non-power-of-two
+/// alignments for unusual types.
+static llvm::Align safeAlign(uint64_t a) {
----------------
adams381 wrote:

#210187 landed, so `getABIAlignment` returns a power of two now. Dropped `safeAlign`; the alignment goes straight to `llvm::Align`.


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


More information about the cfe-commits mailing list