Recommit "[VPlan] Switch to checking sinking legality for recurrences in VPlan."
authorFlorian Hahn <flo@fhahn.com>
Thu, 20 Apr 2023 08:31:16 +0000 (09:31 +0100)
committerFlorian Hahn <flo@fhahn.com>
Thu, 20 Apr 2023 08:31:16 +0000 (09:31 +0100)
commit6b8d19d2b57ecd45eb2ff1964798f3cd8c907ac4
tree5e2307b9e221fa4b5e4dffc621ffd8b5fe2f1935
parent9d52f69afef64776b830bb9adc4e1737ff8fc426
Recommit "[VPlan] Switch to checking sinking legality for recurrences in VPlan."

This reverts the revert commit 3d8ed8b5192a59104bfbd5bf7ac84d035ee0a4a5.

The new version of the patch adds a set to avoid duplicating work in
isFixedOrderRecurrence, which was previously done through the removed
SinkAfter map.

Original commit message:
    Building on D142885 and D142589, retire the SinkAfter map from the
    recurrence handling code. It is replaced by checking whether it is
    possible to sink all users of a recurrence directly in VPlan. This
    results in simpler code overall and allows to handle additional cases
    (see the improvements in @test_crash).

    Depends on D142885.
    Depends on D142589.

    Reviewed By: Ayal

    Differential Revision: https://reviews.llvm.org/D142886
llvm/include/llvm/Analysis/IVDescriptors.h
llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
llvm/lib/Analysis/IVDescriptors.cpp
llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
llvm/lib/Transforms/Vectorize/VPlanTransforms.h
llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll
llvm/test/Transforms/LoopVectorize/first-order-recurrence-multiply-recurrences.ll