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

Fix invalid IR from scalarrepl-param-hlsl in ReplaceConstantWithInst #6556

Commits on Apr 25, 2024

  1. Fix invalid IR from scalarrepl-param-hlsl in ReplaceConstantWithInst

    ReplaceConstantWithInst(C, V) replaces uses of C in the current function with V.
    If such a use C is an instruction I, the it replaces uses of C in I with V.
    However, this function did not make sure to only perform this replacement if V
    dominates I. As a result, it may end up replacing uses of C in instructions
    before the definition of V.
    
    The fix is to lazily compute the dominator tree in ReplaceConstantWithInst so
    that we can guard the replacement with that dominance check.
    amaiorano committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    407ce70 View commit details
    Browse the repository at this point in the history