[clang] [CIR] Add Extend (signext/zeroext) handling to CallConvLowering (PR #195745)

via cfe-commits cfe-commits at lists.llvm.org
Wed May 27 15:03:07 PDT 2026


================
@@ -0,0 +1,40 @@
+// Extend with sign_extend = true on a narrow signed integer arg.  The pass
+// keeps the narrow type in the signature (matching Classic Clang's LLVM IR
+// convention) and attaches llvm.signext to the corresponding arg_attrs.
+//
+// The test target's narrow-int Extend rule fires only on MLIR builtin
+// IntegerType, not cir::IntType, so this test uses the injection driver.
+// RUN: cir-opt %s -cir-call-conv-lowering="classification-attr=test_classify" \
+// RUN:   | FileCheck %s
+
+!s8i = !cir.int<s, 8>
+
+#extend_signed_arg = {
----------------
adams381 wrote:

Added `extend-after-ignore.cir` with a [Direct, Ignore, Extend-signed] classification.  It checks that the Ignore slot drops from the signature and that `llvm.signext` lands on the shifted position (original index 2, new index 1).

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


More information about the cfe-commits mailing list