[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

Jon Chesterfield via cfe-commits cfe-commits at lists.llvm.org
Fri May 24 18:54:29 PDT 2024


================
@@ -115,7 +115,13 @@ void AMDGPUABIInfo::computeInfo(CGFunctionInfo &FI) const {
 
 Address AMDGPUABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
                                  QualType Ty) const {
-  llvm_unreachable("AMDGPU does not support varargs");
+  const bool IsIndirect = false;
+  const bool AllowHigherAlign = true;
+  // Would rather not naturally align values
+  // Splitting {char, short} into two separate arguments makes that difficult.
----------------
JonChesterfield wrote:

^structs < 8 bytes are packed into integers, but structs larger than that are spread across multiple parameters in a discarding-padding sense. Better testing revealed that one byte aligning things does not work out robustly, have had to take a different strategy to make all the cases work. However that does mean everything is 4 byte aligned now.

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


More information about the cfe-commits mailing list