[PATCH] D92228: [RISCV] Add MIR tests exposing missed InstAliases
Fraser Cormack via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 30 02:39:55 PST 2020
frasercrmck added a comment.
In D92228#2422014 <https://reviews.llvm.org/D92228#2422014>, @HsiangKai wrote:
> In D92228#2421866 <https://reviews.llvm.org/D92228#2421866>, @craig.topper wrote:
>
>> Adding @arcbbb. Him and I were talking about maybe splitting masked and unmasked into separate instructions. We need to prevent masked instructions from using v0 as a destination. To do that we've been using @earlyclobber, but that prevents any source operand from being the same as the destination. To fix this it might be better to have separate masked and unmasked instructions. Then we won't use @earlyclobber and instead make the masked instruction forbid v0 as a destination with a register class constraint. Not sure how many additional instructions and pseudo instructions that will require. Thoughts?
>
> Initially, I implemented the V instructions using separate classes for masked and unmasked instructions. You could see the difference from
> https://reviews.llvm.org/D69987?vs=228607&id=229020#toc
>
> We need to define some additional classes for masked instructions. After that, we could use multiclass to define unmasked/masked instructions at once.
I think this is definitely worth considering. The `@earlyclobber` isn't modeling what we want, and duplicating instructions saves us having to add some new constraint to llvm.
However I think we should bear in mind that the vector codegen proposal(s) use pseudo instructions for the majority of the pipeline, only resolving to the "final" vector instructions during the `MCInstLower` step. So those are arguably more important to duplicate since they're the ones likely to ever go through register allocation. A quick look shows that we have over 800 vector instructions. That's a rough number, but if we were to naively duplicate them for masked/unmasked/pseudo-masked/pseudo-unmasked we'd have 3200. I've seen worse, but it does get a bit hairy.
So one option we can keep in mind is to duplicate only the pseudos for masked/unmasked, and then keep the existing vector instructions as they are.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92228/new/
https://reviews.llvm.org/D92228
More information about the llvm-commits
mailing list