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

Backport for rust#127286 and rust#127260 #175

Merged
merged 5 commits into from
Jul 5, 2024

Commits on Jul 5, 2024

  1. [X86] var-permute-*.ll - check memory address math

    Expose the memory addressing to simplify checking stack spill/restore manipulation codegen
    
    (cherry picked from commit 8270485)
    RKSimon authored and DianQK committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    30ee39d View commit details
    Browse the repository at this point in the history
  2. [X86] matchAddressRecursively - don't fold zext(shl(x,c)) -> shl(zext…

    …(x),c)) if the pattern has multiple uses
    
    Fixes llvm#97533 crash where we hit a case where the root node had referenced the original zext node, which we then deleted - hopefully I can come up with a better solution, but the codegen changes don't look too bad atm (pulls out a shift from some complex LEA nodes that shared the scaled index).
    
    (cherry picked from commit e975ff0)
    RKSimon authored and DianQK committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    9688bbc View commit details
    Browse the repository at this point in the history
  3. [Mem2Reg] Add some single store tests (NFC)

    For llvm#97702.
    
    (cherry picked from commit e7bfd4d)
    nikic authored and DianQK committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    55cbec4 View commit details
    Browse the repository at this point in the history
  4. [Mem2Reg] Don't use single store optimization for potentially poison …

    …value (llvm#97711)
    
    If there is a single store, then loads must either load the stored value
    or uninitialized memory (undef). If the stored value may be poison, then
    replacing an uninitialized memory load with it would be incorrect. Fall
    back to the generic code in that case.
    
    This PR only fixes the case where there is a literal poison store -- the
    case where the value is non-trivially poison will still get miscompiled
    by phi simplification later, see llvm#96631.
    
    Fixes llvm#97702.
    
    (cherry picked from commit f58930f)
    nikic authored and DianQK committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    9457ded View commit details
    Browse the repository at this point in the history
  5. [Mem2Reg] Always allow single-store optimization for dominating stores

    In llvm#97711 the single-store optimization was disabled for the case
    where the value is potentially poison, as this may produce incorrect
    results for loads of uninitialized memory.
    
    However, this resulted in compile-time regressions. Address these
    by still allowing the single-store optimization to occur in cases
    where the store dominates the load, as we know that such a load
    will always read initialized memory.
    
    (cherry picked from commit daaea12)
    nikic authored and DianQK committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    6d3d4f9 View commit details
    Browse the repository at this point in the history