Uh oh!
There was an error while loading. Please reload this page.
compiler: untangle SIMD alignment assumptions - #137256
Conversation
rustbot
commented
Feb 19, 2025
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
Uh oh!
There was an error while loading. Please reload this page.
RalfJung
commented
Feb 19, 2025
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
RalfJung
commented
Feb 19, 2025
Looking at #130402, |
RalfJung
commented
Feb 19, 2025
(Unrelated, maybe we should rename |
workingjubilee
commented
Feb 19, 2025
What exactly is "causing havoc in the rest of the compiler"? The code that I am adjusting is the layout code. |
Ah, I see what I missed now, GitHub's UI improvements are "even better" when high latency is involved! |
RalfJung
commented
Feb 19, 2025
Yeah sorry I was referring to the issues mentioned here. |
workingjubilee
commented
Feb 19, 2025
will revise accordingly @rustbot author |
3a5fe77 to
a96ec2aCompareworkingjubilee
commented
Feb 19, 2025
@rustbot ready |
workingjubilee
commented
Feb 19, 2025
Will conflict with #136985 so should not be put in the queue yet but is otherwise ready for review |
This comment has been minimized.
This comment has been minimized.
a96ec2a to
efb89c9Compare
This comment has been minimized.
This comment has been minimized.
efb89c9 to
1f1bd7cCompareb611749 to
f964368Compareworkingjubilee
commented
Feb 20, 2025
@bors r=bjorn3,RalfJung |
bors
commented
Feb 20, 2025
workingjubilee
commented
Feb 20, 2025
I swear I have incorporated that diff like five times. |
f964368 to
7173d84Comparerustbot
commented
Feb 20, 2025
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt This PR changes Stable MIR cc @oli-obk, @celinval, @ouz-a Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in compiler/rustc_codegen_gcc Some changes occurred to the CTFE machinery cc @rust-lang/wg-const-eval |
workingjubilee
commented
Feb 20, 2025
huh, unexpected. 🫠 oh well, rebased on #136985 since it will break this anyways |
No functional changes.
This pair of fn was introduced to perform invariant checks for scalars. Their current behavior doesn't mesh as well with checking SIMD types, so change the name of the fn to reflect their actual use-case and refactor the corresponding checks. Also simplify the returns from Option<AbiAndPrefAlign> to Option<Align>, because every site was mapping away the "preferred" alignment anyways.
Introduce a pair of functions that actually describe what they do, because it wasn't clear the alignment is sometimes a forgery.
This is only to fix the build.
7173d84 to
46f7a7dCompareworkingjubilee
commented
Feb 21, 2025
@bors r=bjorn3,RalfJung |
bors
commented
Feb 21, 2025
…-assumptions, r=bjorn3,RalfJung compiler: untangle SIMD alignment assumptions There were a number of puzzling assumptions being made about SIMD types and their layout that I have corrected in this diff. These are mostly no-op edits in actual fact, but they do subtly alter a pair of checks in our invariant-checking and union layout computation that rested on those peculiar assumptions. Those unfortunately stand in the way of any further actual fixes. I submit this for review, even though it's not clearly motivated without its followups, because it should still be possible to independently conclude whether this is correct.
…-assumptions, r=bjorn3,RalfJung compiler: untangle SIMD alignment assumptions There were a number of puzzling assumptions being made about SIMD types and their layout that I have corrected in this diff. These are mostly no-op edits in actual fact, but they do subtly alter a pair of checks in our invariant-checking and union layout computation that rested on those peculiar assumptions. Those unfortunately stand in the way of any further actual fixes. I submit this for review, even though it's not clearly motivated without its followups, because it should still be possible to independently conclude whether this is correct.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135501 (Inject `compiler_builtins` during postprocessing and ensure it is made private) - rust-lang#136543 (intrinsics: unify rint, roundeven, nearbyint in a single round_ties_even intrinsic) - rust-lang#137121 (stabilize `(const_)ptr_sub_ptr`) - rust-lang#137180 (Give `global_asm` a fake body to store typeck results, represent `sym fn` as a hir expr to fix `sym fn` operands with lifetimes) - rust-lang#137256 (compiler: untangle SIMD alignment assumptions) - rust-lang#137298 (Check signature WF when lowering MIR body) - rust-lang#137415 (Remove invalid suggestion of into_iter for extern macro) r? `@ghost` `@rustbot` modify labels: rollup
…-assumptions, r=bjorn3,RalfJung compiler: untangle SIMD alignment assumptions There were a number of puzzling assumptions being made about SIMD types and their layout that I have corrected in this diff. These are mostly no-op edits in actual fact, but they do subtly alter a pair of checks in our invariant-checking and union layout computation that rested on those peculiar assumptions. Those unfortunately stand in the way of any further actual fixes. I submit this for review, even though it's not clearly motivated without its followups, because it should still be possible to independently conclude whether this is correct.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135501 (Inject `compiler_builtins` during postprocessing and ensure it is made private) - rust-lang#136543 (intrinsics: unify rint, roundeven, nearbyint in a single round_ties_even intrinsic) - rust-lang#137121 (stabilize `(const_)ptr_sub_ptr`) - rust-lang#137180 (Give `global_asm` a fake body to store typeck results, represent `sym fn` as a hir expr to fix `sym fn` operands with lifetimes) - rust-lang#137256 (compiler: untangle SIMD alignment assumptions) - rust-lang#137383 (stabilize `unsigned_is_multiple_of`) - rust-lang#137415 (Remove invalid suggestion of into_iter for extern macro) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#135501 (Inject `compiler_builtins` during postprocessing and ensure it is made private) - rust-lang#137121 (stabilize `(const_)ptr_sub_ptr`) - rust-lang#137180 (Give `global_asm` a fake body to store typeck results, represent `sym fn` as a hir expr to fix `sym fn` operands with lifetimes) - rust-lang#137256 (compiler: untangle SIMD alignment assumptions) - rust-lang#137383 (stabilize `unsigned_is_multiple_of`) - rust-lang#137415 (Remove invalid suggestion of into_iter for extern macro) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137256 - workingjubilee:untangle-vector-abi-assumptions, r=bjorn3,RalfJung compiler: untangle SIMD alignment assumptions There were a number of puzzling assumptions being made about SIMD types and their layout that I have corrected in this diff. These are mostly no-op edits in actual fact, but they do subtly alter a pair of checks in our invariant-checking and union layout computation that rested on those peculiar assumptions. Those unfortunately stand in the way of any further actual fixes. I submit this for review, even though it's not clearly motivated without its followups, because it should still be possible to independently conclude whether this is correct.
There were a number of puzzling assumptions being made about SIMD types and their layout that I have corrected in this diff. These are mostly no-op edits in actual fact, but they do subtly alter a pair of checks in our invariant-checking and union layout computation that rested on those peculiar assumptions. Those unfortunately stand in the way of any further actual fixes. I submit this for review, even though it's not clearly motivated without its followups, because it should still be possible to independently conclude whether this is correct.
One of these checks is yours, I believe?
r? RalfJung