[PATCH] D67495: [RISCV] Collect Statistics on Compressed Instructions

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 06:27:50 PST 2020


asb added a comment.

In D67495#1811715 <https://reviews.llvm.org/D67495#1811715>, @lenary wrote:

> In D67495#1800935 <https://reviews.llvm.org/D67495#1800935>, @luismarques wrote:
>
> > LGTM. My only concern was if it made sense to use the same statistic to count in both places, and if we could end up double counting the instructions emitted (now, or in a future LLVM version). After a quick look I didn't really see other targets using the same approach, but I also can't think of a way where this ends up actually being problematic.
>
>
> My understanding is that instructions only go through one of these functions. `RISCVAsmParser.cpp` is used by the assembler only, and the `RISCVAsmPrinter.cpp` is only used by LLVM CodeGen. This should mean that instructions are not double-counted (today). Yes I'm not sure why we have both, I think @asb did this to ensure better layering.


Both are necessary for completeness, and are independent paths for MCInst generation. We did go back and forth a fair bit on exactly where the compression hook should be called and that seemed the most sensible option - I forget the full analysis, but there wasn't a single place we could stick it while remaining localised to the RISC-V backend.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67495/new/

https://reviews.llvm.org/D67495





More information about the llvm-commits mailing list