[PATCH] D118216: [RISCV] LUI used for address computation should not isAsCheapAsAMove

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 12 07:11:54 PST 2022


jrtc27 added a comment.

In D118216#3316773 <https://reviews.llvm.org/D118216#3316773>, @benshi001 wrote:

> In D118216#3316752 <https://reviews.llvm.org/D118216#3316752>, @jrtc27 wrote:
>
>> I objected and still believe this patch is fundamentally wrong. The problem needs solving elsewhere, not like this. Please revert.
>
> Although this solution is far from perfect, it does improve code quality. Could you please show a test case that gets wrong or worse assembly by this patch?
> I suggest we can keep it and go on searching better solutions.

I don't know, but I don't really care, it is blatantly wrong to say `LUI rd, <imm>` is not as cheap as a move, especially so to say `LUI rd, %hi(x)` isn't but `LUI rd, x` is, it's complete nonsense. There are lots of things you can commit that would improve codegen quality but are totally wrong and would get backed out immediately.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118216



More information about the llvm-commits mailing list