[clang] [llvm] [CodeGen][LLVM] Make the `va_list` related intrinsics generic. (PR #85460)

Alex Voicu via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 21 09:40:36 PDT 2024


================
@@ -700,10 +700,13 @@ class MSBuiltin<string name> {
 //===--------------- Variable Argument Handling Intrinsics ----------------===//
 //
 
-def int_vastart : DefaultAttrsIntrinsic<[], [llvm_ptr_ty], [], "llvm.va_start">;
-def int_vacopy  : DefaultAttrsIntrinsic<[], [llvm_ptr_ty, llvm_ptr_ty], [],
-                            "llvm.va_copy">;
-def int_vaend   : DefaultAttrsIntrinsic<[], [llvm_ptr_ty], [], "llvm.va_end">;
+def int_vastart : DefaultAttrsIntrinsic<[],
+                                        [llvm_anyptr_ty], [], "llvm.va_start">;
+def int_vacopy  : DefaultAttrsIntrinsic<[],
+                                        [llvm_anyptr_ty, llvm_anyptr_ty], [],
+                                        "llvm.va_copy">;
----------------
AlexVlx wrote:

It does for our target, but I believe each target has freedom when it comes to implementing the actual `va_list` underlying type (the standard regards it as opaque), so it is probably legal to do things that do not match that. So I'd rather follow up with some AMDGPU specific work, but leave this as general / generic as possible.

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


More information about the cfe-commits mailing list