Depends on D145791
Storing instruction bytes directly in a SmallVector instead of a
raw_ostream yields better encoding performance (in some applications,
the improvment is ~1% of the complete back-end time).
Paths
| Differential D145792
[X86][MC] Emit instructions into SmallVector ClosedPublic Authored by aengelke on Mar 10 2023, 6:57 AM.
Details Summary Depends on D145791 Storing instruction bytes directly in a SmallVector instead of a
Diff Detail
Event TimelineComment Actions It'd be very useful to know why replacing raw_svector_ostream (which is really just a SmallVectorImpl<char> wrapper itself) is so much slower than using SmallVector directly Comment Actions It essentially boils down to having function calls for every written byte, which adds up. I haven't tested with (Thin)LTO yet, but a quick glance at the disassembly of a Fedora-built LLVM (which uses ThinLTO) seems to indicate that such function calls are not eliminated. Comment Actions I have an analysis of the code path: https://reviews.llvm.org/D145791#4185609 This revision is now accepted and ready to land.Mar 10 2023, 11:34 AM This revision now requires changes to proceed.Mar 10 2023, 2:59 PM This revision is now accepted and ready to land.Apr 10 2023, 12:58 PM Closed by commit rG3d86ab9d462f: [X86][MC] Emit instructions into SmallVector (authored by aengelke). · Explain WhyApr 11 2023, 2:50 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 512380 llvm/include/llvm/MC/MCCodeEmitter.h
llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
|