[VPlan] Iterate over phi recipes to detect reductions to fix.
authorFlorian Hahn <flo@fhahn.com>
Sat, 7 Aug 2021 13:02:24 +0000 (14:02 +0100)
committerFlorian Hahn <flo@fhahn.com>
Sat, 7 Aug 2021 13:06:50 +0000 (14:06 +0100)
commita00aafc30dbcd24c9258e3cb575d2afb49266df0
tree809895cbdda3954e96b21a319245215f496f9de7
parent45685a1fc4524579a25b03eb1a27e8fcb792afc7
[VPlan] Iterate over phi recipes to detect reductions to fix.

After refactoring the phi recipes, we can now iterate over all header
phis in a VPlan to detect reductions when it comes to fixing them up
when tail folding.

This reduces the coupling with the cost model & legal by using the
information directly available in VPlan. It also removes a call to
getOrAddVPValue, which references the original IR value which may
become outdated after VPlan transformations.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D100102
llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp