aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCObjectStreamer.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-06-27 09:43:32 -0700
committerGitHub <noreply@github.com>2024-06-27 09:43:32 -0700
commitaa3589f0ccc0848fa8d5847afdbc8dd9b9c624e7 (patch)
tree72bd74143966a518e45a0dbbc9a33fe59467c991 /llvm/lib/MC/MCObjectStreamer.cpp
parent4168233badd4de41fee1bdc0a9701c5360ea1ead (diff)
downloadllvm-aa3589f0ccc0848fa8d5847afdbc8dd9b9c624e7.zip
llvm-aa3589f0ccc0848fa8d5847afdbc8dd9b9c624e7.tar.gz
llvm-aa3589f0ccc0848fa8d5847afdbc8dd9b9c624e7.tar.bz2
[MC,X86] emitInstruction: remove virtual function calls due to Intel JCC Erratum
https://reviews.llvm.org/D70157 (for Intel Jump Conditional Code Erratum) introduced two virtual function calls in the generic MCObjectStreamer::emitInstruction, which added some overhead. This patch removes the virtual function overhead: * Define `llvm::X86_MC::emitInstruction` that calls `emitInstruction{Begin,End}`. * Define {X86ELFStreamer,X86WinCOFFStreamer}::emitInstruction to call `llvm::X86_MC::emitInstruction` Pull Request: https://github.com/llvm/llvm-project/pull/96835
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index 5dc73c5..fec1cce 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -330,9 +330,7 @@ void MCObjectStreamer::emitInstruction(const MCInst &Inst,
"' cannot have instructions");
return;
}
- getAssembler().getBackend().emitInstructionBegin(*this, Inst, STI);
emitInstructionImpl(Inst, STI);
- getAssembler().getBackend().emitInstructionEnd(*this, Inst);
}
void MCObjectStreamer::emitInstructionImpl(const MCInst &Inst,