Related to https://reviews.llvm.org/D80916
This required to modify the helper function FoldBranchToCommonDest, but it also has the surprising side effect to make the simplification more efficient in at least one tested case, thus the test update.
Paths
| Differential D81237
Correctly report modified status for SimplifyCFG and LoopSimplify ClosedPublic Authored by serge-sans-paille on Jun 5 2020, 12:52 AM.
Details Summary Related to https://reviews.llvm.org/D80916 This required to modify the helper function FoldBranchToCommonDest, but it also has the surprising side effect to make the simplification more efficient in at least one tested case, thus the test update.
Diff Detail Event Timeline
Comment Actions Rework FoldBranchToCommonDest to correctly report status, so that we don't make its signature too complex.
Comment Actions LGTM except for the minor comments inline.
This revision is now accepted and ready to land.Jun 10 2020, 1:51 AM Closed by commit rG9daccb7a477b: Correctly update Changed status for SimplifyCFG (authored by serge-sans-paille). · Explain WhyJun 10 2020, 8:13 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 268690 llvm/include/llvm/Transforms/Utils/Local.h
llvm/lib/Transforms/Utils/LoopSimplify.cpp
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/fold-branch-debuginvariant.ll
|
Needs a comment to explain what's going on: "returns true on success, but note that even on failure we might have changed some IR, in which case *Modified is set to true" or similar.
Alternatively, rearrange things so that we don't make any changes until we know we're going to succeed.