[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 27 02:43:21 PDT 2024
================
@@ -1185,6 +1189,9 @@ Currently, only the following parameter attributes are defined:
value should be sign-extended to the extent required by the target's
ABI (which is usually 32-bits) by the caller (for a parameter) or
the callee (for a return value).
+``noext`` This indicates to the code generator that the parameter or return
+ value has the high bits undefined, as for a struct in register, and
+ therefore does not need to be sign or zero extended.
----------------
phoebewang wrote:
There doesn't exist an "IR ABI". If you don't specify a calling convention in IR, [it must be C calling convention](https://llvm.org/docs/LangRef.html#calling-conventions).
Or you want to call representations out of C ABI definition "IR ABI"? I cannot agree with either. A typical ABI has two merits: well documented and stable. Neither do they have. They are almost exceptions unconsciously generated front end or written by hand. They exist just because we lack a verifier for them.
My suggestion is to introduce ABI verification code for each target in the IR verifier like [this](https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/Verifier.cpp#L2333-L2339). We may start from cases we care most and gradually check all rules followed by clang front end.
https://github.com/llvm/llvm-project/pull/100757
More information about the llvm-commits
mailing list