From a698e231ae9ceea3ec0ce75c3bc7c44f9dd4d130 Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Sun, 23 Dec 2018 12:04:55 +0000 Subject: [PATCH] [ORC] Remove redundant instruction from MIPS resolver code. NFC It's redundant to restore the `$a3` register twice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350021 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ExecutionEngine/Orc/OrcABISupport.h | 2 +- lib/ExecutionEngine/Orc/OrcABISupport.cpp | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/llvm/ExecutionEngine/Orc/OrcABISupport.h b/include/llvm/ExecutionEngine/Orc/OrcABISupport.h index 49e7b534f21..6b748e58ea0 100644 --- a/include/llvm/ExecutionEngine/Orc/OrcABISupport.h +++ b/include/llvm/ExecutionEngine/Orc/OrcABISupport.h @@ -245,7 +245,7 @@ class OrcMips32_Base { public: static const unsigned PointerSize = 4; static const unsigned TrampolineSize = 20; - static const unsigned ResolverCodeSize = 0xfc; + static const unsigned ResolverCodeSize = 0xf8; using IndirectStubsInfo = GenericIndirectStubsInfo<16>; using JITReentryFn = JITTargetAddress (*)(void *CallbackMgr, diff --git a/lib/ExecutionEngine/Orc/OrcABISupport.cpp b/lib/ExecutionEngine/Orc/OrcABISupport.cpp index cf335df0e7c..2f2a04293b9 100644 --- a/lib/ExecutionEngine/Orc/OrcABISupport.cpp +++ b/lib/ExecutionEngine/Orc/OrcABISupport.cpp @@ -604,19 +604,18 @@ void OrcMips32_Base::writeResolverCode(uint8_t *ResolverMem, JITReentryFn Reentr 0x8fb1001c, // 0xd4: lw $s1,28($sp) 0x8fb00018, // 0xd8: lw $s0,24($sp) 0x8fa70014, // 0xdc: lw $a3,20($sp) - 0x8fa70014, // 0xe0: lw $a3,20($sp) - 0x8fa60010, // 0xe4: lw $a2,16($sp) - 0x8fa5000c, // 0xe8: lw $a1,12($sp) - 0x8fa40008, // 0xec: lw $a0,8($sp) - 0x27bd0068, // 0xf4: addiu $sp,$sp,104 - 0x0300f825, // 0xf8: move $ra, $t8 - 0x00000000 // 0xfc: jr $v0/v1 + 0x8fa60010, // 0xe0: lw $a2,16($sp) + 0x8fa5000c, // 0xe4: lw $a1,12($sp) + 0x8fa40008, // 0xe8: lw $a0,8($sp) + 0x27bd0068, // 0xec: addiu $sp,$sp,104 + 0x0300f825, // 0xf0: move $ra, $t8 + 0x00000000 // 0xf4: jr $v0/v1 }; const unsigned ReentryFnAddrOffset = 0x7c; // JIT re-entry fn addr lui const unsigned CallbackMgrAddrOffset = 0x6c; // Callback manager addr lui - const unsigned offsett = 0xfc; + const unsigned offsett = 0xf4; memcpy(ResolverMem, ResolverCode, sizeof(ResolverCode)); -- 2.11.0