[PATCH] D27799: [XRay][compiler-rt][NFC] Deduplicate code in x86-64 trampolines.

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 00:54:07 PST 2016

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

Comment at: lib/xray/xray_trampoline_x86_64.S:16
-	.text
-	.file "xray_trampoline_x86.S"
-	.globl __xray_FunctionEntry
-	.align 16, 0x90
-	.type __xray_FunctionEntry, at function
-  .cfi_startproc
-  // Save caller provided registers before doing any actual work.
-	pushq %rbp
-	.cfi_def_cfa_offset 16
 	subq $200, %rsp
Consider naming this `SAVE_REGISTERS` to make it a bit more natural to read.

Comment at: lib/xray/xray_trampoline_x86_64.S:35
-	// de-mangled, that's __xray::XRayPatchedFunction, and we're doing an acquire
-	// load (on x86 is a normal mov instruction).
-	movq	_ZN6__xray19XRayPatchedFunctionE(%rip), %rax
-	testq	%rax, %rax
-	je	.Ltmp0
-	// assume that %r10d has the function id.
-	movl	%r10d, %edi
-	xor	%esi,%esi
-	callq	*%rax
-  // restore the registers
 	movupd	184(%rsp), %xmm0
Same idea here, as `RESTORE_REGISTERS`.


More information about the llvm-commits mailing list