cg_LLVM: Stop needing an alloca for volatile loads#157127
Conversation
ff8746f to
9ff8e99
Compare
|
The GCC codegen subtree was changed |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9ff8e99 to
d82afbd
Compare
This comment has been minimized.
This comment has been minimized.
d82afbd to
b5c38a6
Compare
This comment has been minimized.
This comment has been minimized.
b5c38a6 to
d844e5f
Compare
|
|
||
| fn volatile_load(&mut self, ty: Type<'gcc>, ptr: RValue<'gcc>) -> RValue<'gcc> { | ||
| fn volatile_load(&mut self, ty: Type<'gcc>, ptr: RValue<'gcc>, _: Align) -> RValue<'gcc> { | ||
| // FIXME(antoyo): set alignment. |
There was a problem hiding this comment.
annot: it wasn't obvious to me how to get this to work -- maybe that's why it was already a FIXME -- so I ended up just moving the FIXME from the volatile_load intrinsic to the volatile_load builder method, which doesn't make anything worse at least.
This comment has been minimized.
This comment has been minimized.
d844e5f to
9032be2
Compare
|
Sorry for taking a bazillion iterations on this. CI is happy now, so I think this is finally |
This comment has been minimized.
This comment has been minimized.
And while I'm here, improve the tests to check that the unaligned ones are actually unaligned, since `unaligned_volatile_load::<u8>` doesn't actually test anything.
9032be2 to
9b188dd
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ I would not be surprised if this breaks someones embedded code because they expected a volatile load of a struct to be split in some specific way. I guess we'll find out... |
…ve, r=nikic cg_LLVM: Stop needing an alloca for volatile loads This ended up also being reimplementing it to not use `load` of the `llvm_type`, since without doing that everything blew up horribly. cc the zulip conversation [#t-opsem > Defining volatile splitting @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Defining.20volatile.20splitting/near/597451615). And while I'm here, improve the tests to check that the unaligned ones are actually unaligned, since `unaligned_volatile_load::<u8>` doesn't actually test anything. r? @nikic cc @RalfJung MCP tracking issue rust-lang#153250
…uwer Rollup of 4 pull requests Successful merges: - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 4 pull requests Successful merges: - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…ve, r=nikic cg_LLVM: Stop needing an alloca for volatile loads This ended up also being reimplementing it to not use `load` of the `llvm_type`, since without doing that everything blew up horribly. cc the zulip conversation [#t-opsem > Defining volatile splitting @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Defining.20volatile.20splitting/near/597451615). And while I'm here, improve the tests to check that the unaligned ones are actually unaligned, since `unaligned_volatile_load::<u8>` doesn't actually test anything. r? @nikic cc @RalfJung MCP tracking issue rust-lang#153250
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…ve, r=nikic cg_LLVM: Stop needing an alloca for volatile loads This ended up also being reimplementing it to not use `load` of the `llvm_type`, since without doing that everything blew up horribly. cc the zulip conversation [#t-opsem > Defining volatile splitting @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Defining.20volatile.20splitting/near/597451615). And while I'm here, improve the tests to check that the unaligned ones are actually unaligned, since `unaligned_volatile_load::<u8>` doesn't actually test anything. r? @nikic cc @RalfJung MCP tracking issue rust-lang#153250
…uwer Rollup of 7 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
This ended up also being reimplementing it to not use
loadof thellvm_type, since without doing that everything blew up horribly. cc the zulip conversation #t-opsem > Defining volatile splitting @ 💬.And while I'm here, improve the tests to check that the unaligned ones are actually unaligned, since
unaligned_volatile_load::<u8>doesn't actually test anything.r? @nikic
cc @RalfJung
MCP tracking issue #153250