[VPlan] Do not sink uniform recipes in sinkScalarOperands.
authorFlorian Hahn <flo@fhahn.com>
Thu, 27 May 2021 12:53:33 +0000 (13:53 +0100)
committerFlorian Hahn <flo@fhahn.com>
Thu, 27 May 2021 13:07:48 +0000 (14:07 +0100)
commit38641ddf3e5630db6ecb167b2d1b520b22e56405
treea8dd3d370eba0af5e3406b7f9a2e4e0ceefd7979
parent8edd3464afbff65d7d5945b3a8b20009d6ff5deb
[VPlan] Do not sink uniform recipes in sinkScalarOperands.

For uniform ReplicateRecipes, only the first lane should be used, so
sinking them would mean we have to compute the value of the first lane
multiple times. Also, at the moment, sinking them causes a crash because
the value of the first lane is re-used by all users.

Reported post-commit for D100258.
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
llvm/test/Transforms/LoopVectorize/vplan-sink-scalars-and-merge-vf1.ll
llvm/test/Transforms/LoopVectorize/vplan-sink-scalars-and-merge.ll