[PATCH] D102893: [RISCV] Optimize xor/or with immediate in the zbs extension
Ben Shi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 20 19:39:02 PDT 2021
benshi001 added a comment.
In D102893#2772744 <https://reviews.llvm.org/D102893#2772744>, @craig.topper wrote:
> In D102893#2772692 <https://reviews.llvm.org/D102893#2772692>, @jrtc27 wrote:
>
>> Given how messy this is becoming and the amount of duplicated code for what are very similar patterns, does this not just want to be custom lowering? TableGen is starting to feel like the wrong tool for this.
>>
>> Also, just a side thought: how does all this interact with using the integers for things like load or store offsets? Do we end up not being able to fold an immediate into the load/store as a result of some of these optimisations and thus lose out overall on large-offset addressing when B is enabled?
>
> I’m not sure custom lowering is the right tool either. Making OR/XOR Custom will likely have other effects. Maybe custom isel in RISCVISelDAGToDAG?
>
> These are immediates being used only by an OR/XOR so I don’t think it affects loads/stores folding. Am I missing something?
How about make the duplicate parts of the two PatLeaf to a function, and then call it in the two PatLeaf? This way would make it more readable and clear.
I do not think ISelDagToDag is good, it even introduces more lines than current form.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102893/new/
https://reviews.llvm.org/D102893
More information about the llvm-commits
mailing list