[LLVMdev] struct passing on X86-64

David Meyer pdox at google.com
Thu Jun 9 11:59:30 PDT 2011


It appears the X86-64 backend doesn't currently respect the X86-64 ABI
with respect to struct passing (by value).

For example:
  %struct.tiny = type { i32, i32 }
  call void @foo(%struct.tiny %1) nounwind

Will actually pass two i32 register arguments (%edi,%esi) instead of a
single i64 register argument (%rdi).

The frontends (llvm-gcc, clang) appear to do the argument munging
themselves in order to compensate.

Any plans or suggestions for implementing this properly in the backend?

Thanks,
  David M



More information about the llvm-dev mailing list