[PATCH] D105199: [LoopVectorize] Fix scalable vector crash in VPReplicateRecipe::execute

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 03:17:56 PDT 2021


fhahn added a comment.

In D105199#2857611 <https://reviews.llvm.org/D105199#2857611>, @david-arm wrote:

> In D105199#2857606 <https://reviews.llvm.org/D105199#2857606>, @fhahn wrote:
>
>> IIUC from the description, this recipe effectively either widens the instruction or just computes the first lane if it is uniform. Does it handle any other case?
>
> Yes. If you look at the new scalarizeInstruction() it also broadcasts a value into a new instruction if the result is non-void and *all* operands are loop invariant. This is a it different to the original scalarizeInstruction function that simply creates a scalar instruction per lane, generating the same value each time. This tests the `extractvalue` case in one of the tests.

Ok thanks. So effectively this handles 3 different cases (the instruction could be widened and only the first lane needs to be computed, with calls to `llvm.experimental.noalias.scope.decl` being a special case, where generating it once in the loop is also sufficient ), which should not really specific to scalable vectors, but for scalable vectors it crashes, right?

I'm not sure if we actually need a new recipe for those cases and we might be able to adjust the recipes in the plan to similar effect. Let sketch an alternative and share it later today or tomorrow.


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

https://reviews.llvm.org/D105199



More information about the llvm-commits mailing list