[llvm] r197416 - [Stackmap] The first integer argument is passed in register for the WebKit_JS calling convention.
Juergen Ributzka
juergen at apple.com
Mon Dec 16 11:53:31 PST 2013
Author: ributzka
Date: Mon Dec 16 13:53:31 2013
New Revision: 197416
URL: http://llvm.org/viewvc/llvm-project?rev=197416&view=rev
Log:
[Stackmap] The first integer argument is passed in register for the WebKit_JS calling convention.
Pass the first integer argument (callee) in register to optimize inline caches.
Modified:
llvm/trunk/lib/Target/X86/X86CallingConv.td
llvm/trunk/test/CodeGen/X86/patchpoint.ll
Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=197416&r1=197415&r2=197416&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CallingConv.td (original)
+++ llvm/trunk/lib/Target/X86/X86CallingConv.td Mon Dec 16 13:53:31 2013
@@ -357,6 +357,10 @@ def CC_X86_64_WebKit_JS : CallingConv<[
// Promote i8/i16 arguments to i32.
CCIfType<[i8, i16], CCPromoteToType<i32>>,
+ // Only the first integer argument is passed in register.
+ CCIfType<[i32], CCAssignToReg<[EDI]>>,
+ CCIfType<[i64], CCAssignToReg<[RDI]>>,
+
// Integer/FP values are always stored in stack slots that are 8 bytes in size
// and 8-byte aligned.
CCIfType<[i32, i64, f32, f64], CCAssignToStack<8, 8>>
Modified: llvm/trunk/test/CodeGen/X86/patchpoint.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/patchpoint.ll?rev=197416&r1=197415&r2=197416&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/patchpoint.ll (original)
+++ llvm/trunk/test/CodeGen/X86/patchpoint.ll Mon Dec 16 13:53:31 2013
@@ -39,23 +39,23 @@ entry:
}
; Test the webkit_jscc calling convention.
-; Two arguments will be pushed on the stack.
+; One argument will be passed in register, the other will be pushed on the stack.
; Return value in $rax.
define void @jscall_patchpoint_codegen(i64 %p1, i64 %p2, i64 %p3, i64 %p4) {
entry:
; CHECK-LABEL: jscall_patchpoint_codegen:
; CHECK: Ltmp
-; CHECK: movq %r{{.+}}, 8(%rsp)
; CHECK: movq %r{{.+}}, (%rsp)
+; CHECK: movq %r{{.+}}, %rdi
; CHECK: Ltmp
; CHECK-NEXT: movabsq $-559038736, %r11
; CHECK-NEXT: callq *%r11
-; CHECK: movq %rax, 8(%rsp)
+; CHECK: movq %rax, (%rsp)
; CHECK: callq
%resolveCall2 = inttoptr i64 -559038736 to i8*
- %result = tail call webkit_jscc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 5, i32 15, i8* %resolveCall2, i32 2, i64 %p1, i64 %p2)
+ %result = tail call webkit_jscc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 5, i32 15, i8* %resolveCall2, i32 2, i64 %p4, i64 %p2)
%resolveCall3 = inttoptr i64 -559038737 to i8*
- tail call webkit_jscc void (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.void(i64 6, i32 15, i8* %resolveCall3, i32 2, i64 %p1, i64 %result)
+ tail call webkit_jscc void (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.void(i64 6, i32 15, i8* %resolveCall3, i32 2, i64 %p4, i64 %result)
ret void
}
More information about the llvm-commits
mailing list