[VPlan] Fix crash caused by not updating all users properly.
authorFlorian Hahn <flo@fhahn.com>
Sun, 12 Sep 2021 16:53:40 +0000 (17:53 +0100)
committerFlorian Hahn <flo@fhahn.com>
Sun, 12 Sep 2021 17:10:53 +0000 (18:10 +0100)
commit368af7558e55039e4e93c3eed68ce00da86e5e35
treed4fa25141958411c8b246999813334f24196f87f
parent4189e5fe12b6f9b9036d8faffeab15ad6acd7d99
[VPlan] Fix crash caused by not updating all users properly.

Users of VPValues are managed in a vector, so we need to be more
careful when iterating over users while updating them. For now, just
copy them.

Fixes 51798.
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
llvm/test/Transforms/LoopVectorize/vplan-sink-scalars-and-merge.ll