[PATCH] D114060: [RISCV][NFC] Simplify immediate materialisation

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 17 00:05:56 PST 2021


benshi001 added a comment.

In D114060#3136769 <https://reviews.llvm.org/D114060#3136769>, @craig.topper wrote:

> In D114060#3136742 <https://reviews.llvm.org/D114060#3136742>, @benshi001 wrote:
>
>> In D114060#3136735 <https://reviews.llvm.org/D114060#3136735>, @craig.topper wrote:
>>
>>> Is the compiler simplicity worth making the assembly harder to read since it won't print zext.w anymore?
>>
>> The immediate materialisation already become more tricky with SHxADD/BCLRI/BSETI/SLLIUW, most assembly sequances are not obvious, so is it necessary to keep immediate materialisation assembly readable ?
>
> I'm not arguing the readability of the whole immediate materialization itself. That you have to be able to read like any other instructions. My concern is that this is the only time the compiler will emit a slli.uw with a zero shift amount and there's no alias for it. It might be surprising the first time someone sees it.

According to the spec of the B extension, "zext.w" has already been aliased to "add.uw x, zero", so how about making a new alias like "zext32 x" to "slli.uw t, 0" ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114060



More information about the llvm-commits mailing list