-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Rollup of 4 pull requests #135370
Rollup of 4 pull requests #135370
Conversation
…constant as pattern When we encounter a constant in a pattern, we check if it is non-structural. If so, we check if the type implements `PartialEq`, but for types with escaping bound vars the check would be incorrect as is, so we break early. This is ok because these types would be filtered anyways. Fix rust-lang#134764.
Replace tuple with struct and remove unnecessary early return.
This should make it clearer that this bitset is dense, with the advantages and disadvantages that it entails.
…jubilee add `-Zmin-function-alignment` tracking issue: rust-lang#82232 This PR adds the `-Zmin-function-alignment=<align>` flag, that specifies a minimum alignment for all* functions. ### Motivation This feature is requested by RfL [here](rust-lang#128830): > i.e. the equivalents of `-fmin-function-alignment` ([GCC](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fmin-function-alignment_003dn), Clang does not support it) / `-falign-functions` ([GCC](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-falign-functions), [Clang](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang1-falign-functions)). > > For the Linux kernel, the behavior wanted is that of GCC's `-fmin-function-alignment` and Clang's `-falign-functions`, i.e. align all functions, including cold functions. > > There is [`feature(fn_align)`](rust-lang#82232), but we need to do it globally. ### Behavior The `fn_align` feature does not have an RFC. It was decided at the time that it would not be necessary, but maybe we feel differently about that now? In any case, here are the semantics of this flag: - `-Zmin-function-alignment=<align>` specifies the minimum alignment of all* functions - the `#[repr(align(<align>))]` attribute can be used to override the function alignment on a per-function basis: when `-Zmin-function-alignment` is specified, the attribute's value is only used when it is higher than the value passed to `-Zmin-function-alignment`. - the target may decide to use a higher value (e.g. on x86_64 the minimum that LLVM generates is 16) - The highest supported alignment in rust is `2^29`: I checked a bunch of targets, and they all emit the `.p2align 29` directive for targets that align functions at all (some GPU stuff does not have function alignment). *: Only with `build-std` would the minimum alignment also be applied to `std` functions. --- cc `@ojeda` r? `@workingjubilee` you were active on the tracking issue
Avoid ICE: Account for `for<'a>` types when checking for non-structural type in constant as pattern When we encounter a constant in a pattern, we check if it is non-structural. If so, we check if the type implements `PartialEq`, but for types with escaping bound vars the check would be incorrect as is, so we break early. This is ok because these types would be filtered anyways. Slight tweak to output to remove unnecessary context as a drive-by. Fix rust-lang#134764.
Rename `BitSet` to `DenseBitSet` r? `@Mark-Simulacrum` as you requested this in rust-lang#134438 (comment) after such a confusion. This PR renames `BitSet` to `DenseBitSet` to make it less obvious as the go-to solution for bitmap needs, as well as make its representation (and positives/negatives) clearer. It also expands the comments there to hopefully make it clearer when it's not a good fit, with some alternative bitsets types. (This migrates the subtrees cg_gcc and clippy to use the new name in separate commits, for easier review by their respective owners, but they can obvs be squashed)
…res, r=wesleywiser Eagerly collect mono items for non-generic closures This allows users to use `-Zprint-mono-items=eager` to eagerly monomorphize closures and coroutine bodies, in case they want to inspect the LLVM or ASM for those items. `-Zprint-mono-items`, which used to be called `-Zprint-trans-items`, was originally added in rust-lang#30900: > Eager mode is meant to be used in conjunction with incremental compilation > where a stable set of translation items is more important than a minimal > one. Thus, eager mode will instantiate drop-glue for every drop-able type > in the crate, even of no drop call for that type exists (yet). It will > also instantiate default implementations of trait methods, something that > otherwise is only done on demand. Although it remains an unstable option, its purpose has somewhat expanded since then, and as far as I can tell it's generally useful for cases when you want to monomorphize as many items as possible, even if they're unreachable. Specifically, it's useful for debugging since you can look at the codegen'd body of a function, since we don't emit items that are not reachable in monomorphization. And even more specifically, it would be very to monomorphize the coroutine body of an async fn, since those you can't easily call those without a runtime. This PR enables this usecase since we now monomorphize `DefKind::Closure`.
@bors r+ rollup=never p=4 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: fb65a3ee57 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (eb54a50): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.1%, secondary 3.4%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 763.38s -> 762.326s (-0.14%) |
Successful merges:
-Zmin-function-alignment
#134030 (add-Zmin-function-alignment
)for<'a>
types when checking for non-structural type in constant as pattern #134776 (Avoid ICE: Account forfor<'a>
types when checking for non-structural type in constant as pattern)BitSet
toDenseBitSet
#135205 (RenameBitSet
toDenseBitSet
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup