================
@@ -0,0 +1,68 @@
+
+// RUN: cir-opt %s -cir-call-conv-lowering="classification-attr=test_classify"
\
+// RUN: | FileCheck %s
+
+!s8i = !cir.int<s, 8>
+!u8i = !cir.int<u, 8>
+
+#extend_signed_return = {
+ return = { kind = "extend",
+ coerced_type = !cir.int<s, 32>,
+ sign_extend = true },
+ args = [ ]
+}
+
+#extend_unsigned_return = {
+ return = { kind = "extend",
+ coerced_type = !cir.int<u, 32>,
+ sign_extend = false },
+ args = [ ]
+}
+
+module attributes {
+ dlti.dl_spec = #dlti.dl_spec<
+ #dlti.dl_entry<i8, dense<8>: vector<2xi64>>,
+ #dlti.dl_entry<i32, dense<32>: vector<2xi64>>>
+} {
+ // An existing zeroext must be replaced with signext.
+ cir.func @returns_s8() -> (!s8i {llvm.zeroext})
----------------
Siya-05 wrote:
I've updated the implementation to reject result extension attributes that
conflict with the integer result type's signedness, rather than silently
replacing them during ABI lowering.
The validation now covers cir.func, direct and indirect cir.call, and
cir.try_call. I noticed that CIR also uses llvm.zeroext for boolean results, so
I've kept the signedness checks specific to integer types.
Should we add validation for non-integer result types as well?
https://github.com/llvm/llvm-project/pull/237558
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits