[VPlan] Allow sinking of instructions with no defs
authorEvgeniy Brevnov <ybrevnov@azul.com>
Tue, 23 May 2023 11:53:04 +0000 (18:53 +0700)
committerEvgeniy Brevnov <ybrevnov@azul.com>
Tue, 4 Jul 2023 09:53:06 +0000 (16:53 +0700)
commitd7329653d0f97c9087053e91002fa1793e910f92
tree1f54ba68a686a1a5ece806de3a37a19589971c11
parent1f082d2da0d7332e36c48ba3c626f01c464954de
[VPlan] Allow sinking of instructions with no defs

We started seeing new failure after D142886. Looks like it enabled new cases and we hit an assert:
assert(Current->getNumDefinedValues() == 1 &&
           "only recipes with a single defined value expected");

 When we do instruction sinking for the first order recurrence we hit an assert if instruction doesn't have single def. In case instruction doesn't produce any new def there is no new users and nothing to sink.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D151204
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains-vplan.ll
llvm/test/Transforms/LoopVectorize/first-order-recurrence-multiply-recurrences.ll