[PATCH] D107965: Fix X86-64 ABIT issue when splitting an i128 into two i64 during function call

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 14 18:48:24 PDT 2021


pengfei requested changes to this revision.
pengfei added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Target/X86/X86CallingConv.td:545
   CCIfType<[i32], CCAssignToReg<[EDI, ESI, EDX, ECX, R8D, R9D]>>,
+  CCIfConsecutiveRegs<CCIf<"NotEnoughRemaingRegisters(ArgFlags, State)", CCAssignToStack<8, 16>>>,
   CCIfType<[i64], CCAssignToReg<[RDI, RSI, RDX, RCX, R8 , R9 ]>>,
----------------
This is not correct. See the generated code in large-argument-count-i128.ll:12. We want the i128 (consecutive 2 i64) memory is 16 byte aligned instead of 2 i64 that aligned 16 bytes.


================
Comment at: llvm/test/CodeGen/X86/large-argument-count-i128.ll:12
+; CHECK-NEXT:	movl	%edi, 36(%rsp)
+; CHECK-NEXT:	movq	$0, 16(%rsp)
+; CHECK-NEXT:	movq	$1, (%rsp)
----------------
This should be 8?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107965/new/

https://reviews.llvm.org/D107965



More information about the llvm-commits mailing list