[PATCH] D66210: [RFC/WIP][RISCV] Enable the machine outliner for RISC-V

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 12:36:44 PDT 2019


efriedma added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:496
+  for (; I != E; ++I)
+    SequenceSize += getInstSizeInBytes(*I);
+
----------------
luismarques wrote:
> efriedma wrote:
> > luismarques wrote:
> > > This might be pessimistic when the instructions are compressible. Suddenly the outlined amount vs the overhead math might not quite be realistic. I think it's worth devising a test to try to explore how much of a problem that is, and if we can compensate for it by, say, tweaking the overhead numbers, or determining if the instruction is likely to be compressible, or being conservative regarding the instruction size when targeting RVC.
> > Wouldn't you want getInstSizeInBytes to account for compression for other reasons, anyway?  For example, to avoid triggering branch relaxation when it isn't necessary.
> @efriedma I was assuming it wouldn't be possible to make `getInstSizeInBytes` fully account for compression due to relaxations and/or compression being done by the linker, but if that is possible (or at least a good enough approximation) then that sounds like a good solution.
The linker only changes the size of calls and global address computation, currently.  I mean, I guess it's theoretically possible for it to compress other branches, but that isn't implemented, as far as I know.  So it should be possible to accurately compute the size of almost all compressible instructions.

LLVM currently doesn't do any RISCV compression computation before the assembler runs, but it was only implemented that way to simplify the implementation; it could be done earlier, if it would be useful.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66210





More information about the llvm-commits mailing list