Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InstCombine] Fix infinite loop due to bitcast <-> phi transforms #32

Merged
merged 1 commit into from
Jan 16, 2020

Commits on Jan 16, 2020

  1. [InstCombine] Fix infinite loop due to bitcast <-> phi transforms

    Fix for https://bugs.llvm.org/show_bug.cgi?id=44245.
    
    The optimizeBitCastFromPhi() and FoldPHIArgOpIntoPHI() end up
    fighting against each other, because optimizeBitCastFromPhi()
    assumes that bitcasts of loads will get folded. This doesn't
    happen here, because a dangling phi node prevents the one-use
    fold in https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp#L620-L628 from triggering.
    
    This patch fixes the issue by explicitly performing the load
    combine as part of the bitcast of phi transform. Other attempts
    to force the load to be combined first were ultimately too
    unreliable.
    
    Differential Revision: https://reviews.llvm.org/D71164
    nikic authored and tmandry committed Jan 16, 2020
    Configuration menu
    Copy the full SHA
    8813358 View commit details
    Browse the repository at this point in the history