[LoopVectorizer] Fix inloop reductions mask placement
authorDavid Green <david.green@arm.com>
Thu, 5 Jan 2023 11:37:37 +0000 (11:37 +0000)
committerDavid Green <david.green@arm.com>
Thu, 5 Jan 2023 11:37:37 +0000 (11:37 +0000)
commit586fd86b0a91ef3beb9da664c0ffe5ffb9f19357
treec750563006d74497922c81eb52155c41c5782475
parent7ac6b2fdaf18d7d7c9e80dab647b1c8722205259
[LoopVectorizer] Fix inloop reductions mask placement

The validation of vplans could fail if an inloop reduction was created
with a block-in mask that did not dominate the reduction. This makes
sure that the insert point is set when creating the mask, to ensure it
dominates the reduction.

Differential Revision: https://reviews.llvm.org/D141003
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/reduction-inloop.ll