-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Extend minicore with intrinsics and use it to replace #[rustc_intrinsic] in tests #140037
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
base: master
Are you sure you want to change the base?
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
I am getting this issue
From what I can gather, the problem is that the compiler optimizes out the function? |
This comment has been minimized.
This comment has been minimized.
Not quite. From what I can tell, the key instructions are still present (i.e. if you comment out the E.g. loongarch64 revision (this PR) issue_114508_u32:
sltu $a2, $a1, $a0
masknez $a1, $a1, $a2
maskeqz $a0, $a0, $a2
or $a0, $a0, $a1
ret
.Lfunc_end0:
.size issue_114508_u32, .Lfunc_end0-issue_114508_u32
.section .text.issue_114508_i32,"ax",@progbits
.globl issue_114508_i32
.p2align 5
.type issue_114508_i32,@function
issue_114508_i32:
slt $a2, $a1, $a0
masknez $a1, $a1, $a2
maskeqz $a0, $a0, $a2
or $a0, $a0, $a1
ret
.Lfunc_end1:
.size issue_114508_i32, .Lfunc_end1-issue_114508_i32
.ident "rustc version 1.88.0-dev"
.section ".note.GNU-stack","",@progbits on issue_114508_u32:
.cfi_startproc
sltu $a2, $a1, $a0
masknez $a1, $a1, $a2
maskeqz $a0, $a0, $a2
or $a0, $a0, $a1
ret
.Lfunc_end0:
.size issue_114508_u32, .Lfunc_end0-issue_114508_u32
.cfi_endproc
.section .text.issue_114508_i32,"ax",@progbits
.globl issue_114508_i32
.p2align 5
.type issue_114508_i32,@function
issue_114508_i32:
.cfi_startproc
slt $a2, $a1, $a0
masknez $a1, $a1, $a2
maskeqz $a0, $a0, $a2
or $a0, $a0, $a1
ret
.Lfunc_end1:
.size issue_114508_i32, .Lfunc_end1-issue_114508_i32
.cfi_endproc
.ident "rustc version 1.88.0-dev"
.section ".note.GNU-stack","",@progbits cc @rcvalle do you happen to know why the CFI directives might be missing? FWIW, minicore is built as an rlib + |
EDIT: bjorn3 told me
In this case I think it has to do with minicore being compiled with |
Maybe we just need to add |
That seems like a reasonable solution, I'll make that change separately and document these two preset flags in rdg. |
#140194 will have |
…les, r=bjorn3 minicore: Have `//@ add-core-stubs` also imply `-Cforce-unwind-tables=yes` To preserve CFI directives in assembly tests, as `//@ add-core-stubs` already imply `-C panic=abort`. This is a blocker for rust-lang#140037 (comment). cc `@RalfJung` r? `@bjorn3`
…les, r=bjorn3 minicore: Have `//@ add-core-stubs` also imply `-Cforce-unwind-tables=yes` To preserve CFI directives in assembly tests, as `//@ add-core-stubs` already imply `-C panic=abort`. This is a blocker for rust-lang#140037 (comment). cc ``@RalfJung`` r? ``@bjorn3``
…les, r=bjorn3 minicore: Have `//@ add-core-stubs` also imply `-Cforce-unwind-tables=yes` To preserve CFI directives in assembly tests, as `//@ add-core-stubs` already imply `-C panic=abort`. This is a blocker for rust-lang#140037 (comment). cc ```@RalfJung``` r? ```@bjorn3```
Rollup merge of rust-lang#140194 - jieyouxu:minicore-force-unwind-tables, r=bjorn3 minicore: Have `//@ add-core-stubs` also imply `-Cforce-unwind-tables=yes` To preserve CFI directives in assembly tests, as `//@ add-core-stubs` already imply `-C panic=abort`. This is a blocker for rust-lang#140037 (comment). cc ```@RalfJung``` r? ```@bjorn3```
…orn3 minicore: Have `//@ add-core-stubs` also imply `-Cforce-unwind-tables=yes` To preserve CFI directives in assembly tests, as `//@ add-core-stubs` already imply `-C panic=abort`. This is a blocker for rust-lang/rust#140037 (comment). cc ```@RalfJung``` r? ```@bjorn3```
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
e480e1f
to
54d024e
Compare
@rustbot ready |
Trying to trigger the CI |
You closed this PR so apparently it's not ready? CI gets triggered automatically on pushes. Note that to reopen a PR it must be in the same state as when you closed it, i.e. you have to push it back to whatever the current commit was at that time. Closing and reopening indeed triggers CI but that is rarely ever necessary. |
Ah darn I force pushed :> edit: I might have the branch in my backup... |
This comment has been minimized.
This comment has been minimized.
Ok, now this is the error that I am getting Another question, can you implement Ordering like this?
because I got this error when I use
And I can't find any usages of
|
☔ The latest upstream changes (presumably #140664) made this pull request unmergeable. Please resolve the merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't reformat files you're not even changing in this PR. All of the Miri and Clippy changes should be undone.
Yeah, this is a lang item and it is inserted into the code by the compiler. |
The errors that look like this
are caused by the attribute indices in the LLVM IR shifting around. I think it's possible to write codegen tests that are robust to such index shifts but I don't know how... the easiest fix is to just change the expected numbers in the test. Ensure to replace all occurrences of an index with the new one! |
Given how many issues you are running into, I'd suggest reducing the scope of this PR to only change 1 or 2 files to use minicore. That'll make it much easier. |
Fixes #139918