[llvm] r259968 - [Orc] Slightly improve the x86-64 resolver block machine code.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 5 16:55:08 PST 2016
Author: lhames
Date: Fri Feb 5 18:55:08 2016
New Revision: 259968
URL: http://llvm.org/viewvc/llvm-project?rev=259968&view=rev
Log:
[Orc] Slightly improve the x86-64 resolver block machine code.
Replace leaq + movq of a pointer with a single movabsq.
Modified:
llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h
llvm/trunk/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h?rev=259968&r1=259967&r2=259968&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h Fri Feb 5 18:55:08 2016
@@ -117,7 +117,7 @@ class OrcX86_64 {
public:
static const unsigned PointerSize = 8;
static const unsigned TrampolineSize = 8;
- static const unsigned ResolverCodeSize = 0x78;
+ static const unsigned ResolverCodeSize = 0x6C;
typedef GenericIndirectStubsInfo<8> IndirectStubsInfo;
Modified: llvm/trunk/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp?rev=259968&r1=259967&r2=259968&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp Fri Feb 5 18:55:08 2016
@@ -38,11 +38,14 @@ void OrcX86_64::writeResolverCode(uint8_
0x41, 0x57, // 0x18: pushq %r15
0x48, 0x81, 0xec, 0x08, 0x02, 0x00, 0x00, // 0x1a: subq 0x208, %rsp
0x48, 0x0f, 0xae, 0x04, 0x24, // 0x21: fxsave64 (%rsp)
- 0x48, 0x8d, 0x3d, 0x43, 0x00, 0x00, 0x00, // 0x26: leaq 67(%rip), %rdi
- 0x48, 0x8b, 0x3f, // 0x2d: movq (%rdi), %rdi
+ 0x48, 0xbf, // 0x26: movabsq <CBMgr>, %rdi
+
+ // 0x28: Callback manager addr.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
0x48, 0x8b, 0x75, 0x08, // 0x30: movq 8(%rbp), %rsi
0x48, 0x83, 0xee, 0x06, // 0x34: subq $6, %rsi
- 0x48, 0xb8, // 0x38: movabsq $0, %rax
+ 0x48, 0xb8, // 0x38: movabsq <REntry>, %rax
// 0x3a: JIT re-entry fn addr:
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -67,14 +70,10 @@ void OrcX86_64::writeResolverCode(uint8_
0x58, // 0x69: popq %rax
0x5d, // 0x6a: popq %rbp
0xc3, // 0x6b: retq
- 0x00, 0x00, 0x00, 0x00, // 0x6c: <padding>
-
- // 0x70: Callback mgr address.
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
const unsigned ReentryFnAddrOffset = 0x3a;
- const unsigned CallbackMgrAddrOffset = 0x70;
+ const unsigned CallbackMgrAddrOffset = 0x28;
memcpy(ResolverMem, ResolverCode, sizeof(ResolverCode));
memcpy(ResolverMem + ReentryFnAddrOffset, &ReentryFn, sizeof(ReentryFn));
More information about the llvm-commits
mailing list