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

Subtree sync for rustc_codegen_cranelift #119117

Merged
merged 43 commits into from
Dec 19, 2023

Commits on Nov 24, 2023

  1. Configuration menu
    Copy the full SHA
    abf0832 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2023

  1. Configuration menu
    Copy the full SHA
    1988cf4 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'sync_from_rust'

    bjorn3 committed Nov 25, 2023
    Configuration menu
    Copy the full SHA
    6b82fe2 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#118279 - bjorn3:sync_cg_clif-2023-11-25, r=bj…

    …orn3
    
    Subtree sync for rustc_codegen_cranelift
    
    The main highlights this time are implementing a bunch of new vendor intrinsics and fixing some existing ones. And fixing polymorphization for coroutines.
    
    r? `@ghost`
    
    `@rustbot` label +A-codegen +A-cranelift +T-compiler
    bors committed Nov 25, 2023
    Configuration menu
    Copy the full SHA
    400cd47 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2023

  1. Configuration menu
    Copy the full SHA
    62dbc19 View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2023

  1. Configuration menu
    Copy the full SHA
    f5a74dc View commit details
    Browse the repository at this point in the history
  2. Merge pull request rust-lang#1432 from simonbuchan/windows-y-wrappers

    Add Windows wrappers for ./y
    bjorn3 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    db91a41 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2023

  1. Give Handler::fatal and Session::fatal the same return type.

    Currently, `Handler::fatal` returns `FatalError`. But `Session::fatal`
    returns `!`, because it calls `Handler::fatal` and then calls `raise` on
    the result. This inconsistency is unfortunate.
    
    This commit changes `Handler::fatal` to do the `raise` itself, changing
    its return type to `!`. This is safe because there are only two calls to
    `Handler::fatal`, one in `rustc_session` and one in
    `rustc_codegen_cranelift`, and they both call `raise` on the result.
    
    `HandlerInner::fatal` still returns `FatalError`, so I renamed it
    `fatal_no_raise` to emphasise the return type difference.
    nnethercote committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    0657c1b View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2023

  1. Configuration menu
    Copy the full SHA
    9d9459a View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2023

  1. Sync from rust 1fdfe12

    bjorn3 committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    2559532 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3e81ade View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    994d36b View commit details
    Browse the repository at this point in the history
  4. Fix testing of portable-simd

    bjorn3 committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    1095e01 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#118324 - RalfJung:ctfe-read-only-pointers, r=…

    …saethlin
    
    compile-time evaluation: detect writes through immutable pointers
    
    This has two motivations:
    - it unblocks rust-lang#116745 (and therefore takes a big step towards `const_mut_refs` stabilization), because we can now detect if the memory that we find in `const` can be interned as "immutable"
    - it would detect the UB that was uncovered in rust-lang#117905, which was caused by accidental stabilization of `copy` functions in `const` that can only be called with UB
    
    When UB is detected, we emit a future-compat warn-by-default lint. This is not a breaking change, so completely in line with [the const-UB RFC](https://rust-lang.github.io/rfcs/3016-const-ub.html), meaning we don't need t-lang FCP here. I made the lint immediately show up for dependencies since it is nearly impossible to even trigger this lint without `const_mut_refs` -- the accidentally stabilized `copy` functions are the only way this can happen, so the crates that popped up in rust-lang#117905 are the only causes of such UB (in the code that crater covers), and the three cases of UB that we know about have all been fixed in their respective crates already.
    
    The way this is implemented is by making use of the fact that our interpreter is already generic over the notion of provenance. For CTFE we now use the new `CtfeProvenance` type which is conceptually an `AllocId` plus a boolean `immutable` flag (but packed for a more efficient representation). This means we can mark a pointer as immutable when it is created as a shared reference. The flag will be propagated to all pointers derived from this one. We can then check the immutable flag on each write to reject writes through immutable pointers.
    
    I just hope perf works out.
    bors committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    6353599 View commit details
    Browse the repository at this point in the history
  6. Fix rustc test suite

    bjorn3 committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    3ff8e7b View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2023

  1. Add simd_masked_{load,store} platform-intrinsics

    This maps to the LLVM intrinsics: llvm.masked.load and llvm.masked.store
    farnoy committed Dec 9, 2023
    Configuration menu
    Copy the full SHA
    8ab225d View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2023

  1. remove redundant imports

    detects redundant imports that can be eliminated.
    
    for rust-lang#117772 :
    
    In order to facilitate review and modification, split the checking code and
    removing redundant imports code into two PR.
    surechen committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    e637663 View commit details
    Browse the repository at this point in the history
  2. Sync from rust 06e02d5

    bjorn3 committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    fc1b10c View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2023

  1. Auto merge of rust-lang#117758 - Urgau:lint_pointer_trait_comparisons…

    …, r=davidtwco
    
    Add lint against ambiguous wide pointer comparisons
    
    This PR is the resolution of rust-lang#106447 decided in rust-lang#117717 by T-lang.
    
    ## `ambiguous_wide_pointer_comparisons`
    
    *warn-by-default*
    
    The `ambiguous_wide_pointer_comparisons` lint checks comparison of `*const/*mut ?Sized` as the operands.
    
    ### Example
    
    ```rust
    let ab = (A, B);
    let a = &ab.0 as *const dyn T;
    let b = &ab.1 as *const dyn T;
    
    let _ = a == b;
    ```
    
    ### Explanation
    
    The comparison includes metadata which may not be expected.
    
    -------
    
    This PR also drops `clippy::vtable_address_comparisons` which is superseded by this one.
    
    ~~One thing: is the current naming right? `invalid` seems a bit too much.~~
    
    Fixes rust-lang#117717
    bors committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    b5c0dd6 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2023

  1. Configuration menu
    Copy the full SHA
    aa3dc4c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ace694c View commit details
    Browse the repository at this point in the history
  3. Fix rustc test suite

    bjorn3 committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    7ec47d1 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2023

  1. Auto merge of rust-lang#118534 - RalfJung:extern-type-size-of-val, r=…

    …WaffleLapkin
    
    codegen: panic when trying to compute size/align of extern type
    
    The alignment is also computed when accessing a field of extern type at non-zero offset, so we also panic in that case.
    
    Previously `size_of_val` worked because the code path there assumed that "thin pointer" means "sized". But that's not true any more with extern types. The returned size and align are just blatantly wrong, so it seems better to panic than returning wrong results. We use a non-unwinding panic since code probably does not expect size_of_val to panic.
    bors committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    e3d2831 View commit details
    Browse the repository at this point in the history
  2. Sync from rust 3340d49

    bjorn3 committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    b1cd90a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    45fab3a View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2023

  1. Sync from rust eeff92a

    bjorn3 committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    bb7a126 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b1c925b View commit details
    Browse the repository at this point in the history
  3. update use of feature flags

    lcnr committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    89ab75e View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2023

  1. Configuration menu
    Copy the full SHA
    576b921 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b44315c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b60e208 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8b5a5da View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    eeb3db1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fdcf56c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    697aa0a View commit details
    Browse the repository at this point in the history
  8. Implement has_ptr_meta without computing type layout

    This matches type_has_metadata in cg_ssa and doesn't require computing
    the layout of the type. It is also a bit faster.
    bjorn3 committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    c4567c1 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1ab05b6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    973dd56 View commit details
    Browse the repository at this point in the history
  11. Sync from rust 6a62871

    bjorn3 committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    f6c0006 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9d98f79 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2023

  1. Sync from rust 3f28fe1

    bjorn3 committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    4a1466a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3a9bf72 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d5c38de View commit details
    Browse the repository at this point in the history