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

Ensure ptr::read gets all the same LLVM load metadata that dereferencing does #109035

Merged
merged 6 commits into from
Mar 15, 2023

Commits on Mar 12, 2023

  1. MaybeUninit::assume_init_read should have noundef load metadata

    I was looking into `array::IntoIter` optimization, and noticed that it wasn't annotating the loads with `noundef` for simple things like `array::IntoIter<i32, N>`.
    
    Turned out to be a more general problem as `MaybeUninit::assume_init_read` isn't marking the load as initialized (<https://rust.godbolt.org/z/Mxd8TPTnv>), which is unfortunate since that's basically its reason to exist.
    
    This PR lowers `ptr::read(p)` to `copy *p` in MIR, which fortuitiously also improves the IR we give to LLVM for things like `mem::replace`.
    scottmcm committed Mar 12, 2023
    Configuration menu
    Copy the full SHA
    b2c717f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0b96fee View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1f70bb8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    87696fd View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2023

  1. Configuration menu
    Copy the full SHA
    e7c6ad8 View commit details
    Browse the repository at this point in the history
  2. Split the mem-replace codegen test

    Apparently in CI it's getting generated in the opposite order, one function per file will make the test pass either way.
    scottmcm committed Mar 15, 2023
    Configuration menu
    Copy the full SHA
    dfc3377 View commit details
    Browse the repository at this point in the history