-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Change rustc_codegen_ssa
's atomic_cmpxchg
interface to return a pair of values
#118705
Change rustc_codegen_ssa
's atomic_cmpxchg
interface to return a pair of values
#118705
Conversation
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in compiler/rustc_codegen_gcc cc @antoyo |
This comment has been minimized.
This comment has been minimized.
Seems like it's failing because of cg_gcc tests (added back in #118463). Not sure why though. |
// TODO(antoyo): handle when value is not a struct. | ||
|
||
result.to_rvalue() | ||
( expected.to_rvalue(), success ) |
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.
( expected.to_rvalue(), success ) | |
(expected.to_rvalue(), success) |
@WaffleLapkin This has been fixed in #118706, it was a general issue with PR CI, nothing about your PR. Rebasing should be enough to fix this build issue. |
8a5e2b9
to
0e4ccff
Compare
r=me with @antoyo's green light on the cg_gcc change. |
I see this removed some stuff like the alignment that might still be necessary. @WaffleLapkin: Did you run all the rustc_codegen_gcc's test suite locally (the |
@antoyo I don't think alignment is necessary, it was only used for the stores into the tuple temp. I did not run the tests and looking at it, they are quite cumbersome to setup, so I don't think I'll do it. If you want to run tests yourself I suggest doing |
Ok. I'll run the whole test suite locally just to make sure. |
There's this libcore test that is failing: |
This might also caused by this thing that was noted and changed:
|
Yeah, that was it. The following code makes that test pass: fn atomic_cmpxchg(&mut self, dst: RValue<'gcc>, cmp: RValue<'gcc>, src: RValue<'gcc>, order: AtomicOrdering, failure_order: AtomicOrdering, weak: bool) -> (RValue<'gcc>, RValue<'gcc>) {
let expected = self.current_func().new_local(None, cmp.get_type(), "expected");
self.llbb().add_assignment(None, expected, cmp);
// NOTE: gcc doesn't support a failure memory model that is stronger than the success
// memory model.
let order =
if failure_order as i32 > order as i32 {
failure_order
}
else {
order
};
let success = self.compare_exchange(dst, expected, src, order, failure_order, weak);
// NOTE: since success contains the call to the intrinsic, it must be added to the basic block before
// expected so that we store expected after the call.
let success_var = self.current_func().new_local(None, self.bool_type, "success");
self.llbb().add_assignment(None, success_var, success);
(expected.to_rvalue(), success_var.to_rvalue())
} I haven't ran the rest of the test suite yet. |
0e4ccff
to
6cf6139
Compare
@rustbot ready |
@bors r+ |
…untuple, r=cjgillot Change `rustc_codegen_ssa`'s `atomic_cmpxchg` interface to return a pair of values Doesn't change much, but a little nicer that way.
💔 Test failed - checks-actions |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ddca534): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 671.951s -> 669.614s (-0.35%) |
…untuple, r=cjgillot Change `rustc_codegen_ssa`'s `atomic_cmpxchg` interface to return a pair of values Doesn't change much, but a little nicer that way.
Doesn't change much, but a little nicer that way.