[PATCH] Allow blocks to be merged when one has an undef input to a phi.
Evan Cheng
evan.cheng at apple.com
Mon Jun 17 18:11:33 PDT 2013
Hi Mark,
The revised patch seems fine to me. Have you test against the LLVM test suite and / or a clang self-hosting build?
Thanks,
Evan
On Jun 17, 2013, at 10:41 AM, Mark Lacey <mark.lacey at apple.com> wrote:
> Hi All,
>
> This is a relatively small patch I re-submitted last week which seems to have gotten lost in the shuffle.
>
> Can someone take a look and commit if everything looks good?
>
> Thanks,
>
> Mark
>
>
> TryToSimplifyUncondBranchFromEmptyBlock was checking that any common
> predecessors of the two blocks it is attempting to merge supply the
> same incoming values to any phi in the successor block. This change
> allows merging in the case where there is one or more incoming values
> that are undef. The undef values are rewritten to match the non-undef
> value that flows from the other edge.
>
> Merged the tests from
> - test/Transforms/SimplifyCFG/2008-05-16-PHIBlockMerge.ll
> into
> - test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll
> and also added tests to this file for the situation addressed by this
> patch.
>
> <rdar://problem/12801861>
> ---
> lib/Transforms/Utils/Local.cpp | 76 ++++++-
> .../SimplifyCFG/2008-05-16-PHIBlockMerge.ll | 131 -----------
> .../SimplifyCFG/EqualPHIEdgeBlockMerge.ll | 240 ++++++++++++++++++++-
> 3 files changed, 307 insertions(+), 140 deletions(-)
> delete mode 100644 test/Transforms/SimplifyCFG/2008-05-16-PHIBlockMerge.ll
>
> <0001-Allow-blocks-to-be-merged-when-one-has-an-undef-inpu.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list