[PATCH] D46182: [RISCV] Set isReMaterializable on ADDI and LUI instructions

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 27 13:30:32 PDT 2018


mgrang added a comment.

In https://reviews.llvm.org/D46182#1081552, @asb wrote:

> In https://reviews.llvm.org/D46182#1081488, @mgrang wrote:
>
> > @asb Thanks for the patch. I tested this on our internal workload and it gave us ~44 bytes savings.
> >  However, instead if we mark all ALU insts as isReMaterializable then we get ~226 bytes savings:
> >  Note: Marking ALU insts in addition to ADDI and LUI as isReMaterializable still gave us only ~44 bytes savings.
>
>
> Hi Mandeep - thanks for taking a look. I'm a bit confused, which of the above 3 statements is true?


Sorry for not being clear enough. This patch alone gives us 44 bytes. Internally, I had tried a patch which just marks ALU insts as isReMat and that gave us 226 bytes. But combining the two patches still gives us only 44 bytes.

So I digged a bit more and it seems the degradation in code size comes from marking LUI as isReMaterializable. This results in repeated load zero for our workload:

  lui x10, 0

So in your patch if I simply remove LUI isReMat (and keep ADDI isReMat) then I get 226 bytes (without my the ALU patch).


Repository:
  rL LLVM

https://reviews.llvm.org/D46182





More information about the llvm-commits mailing list