about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-01-09 08:04:37 +0000
committerbors <bors@rust-lang.org>2025-01-09 08:04:37 +0000
commitb6b8361bce8561fb8786ad33ca1abfdf4bc487b6 (patch)
tree335992f511af7f1bdc2c6f202e32c3236e14a215 /compiler/rustc_codegen_llvm/src/llvm/mod.rs
parent65d7296fc9868af121adb5e07358a3815a80a7a1 (diff)
parentb421a563644dafdb8a5a9c48fe21c4a449da18fa (diff)
downloadrust-b6b8361bce8561fb8786ad33ca1abfdf4bc487b6.tar.gz
rust-b6b8361bce8561fb8786ad33ca1abfdf4bc487b6.zip
Auto merge of #133324 - scottmcm:gvn-aggregate-transmute, r=cjgillot
[mir-opt] GVN some more transmute cases

We already did `Transmute`-then-`PtrToPtr`; this adds the nearly-identical `PtrToPtr`-then-`Transmute`.

It also adds `transmute(Foo(x))` → `transmute(x)`, when `Foo` is a single-field transparent type.  That's useful for things like `NonNull { pointer: p }.as_ptr()`.  It also detects when a `Transmute` is just an identity-for-the-value `PtrCast` between different raw pointer types, to help such things fold with other GVN passes.

Found these as I was looking at <https://github.com/rust-lang/compiler-team/issues/807>-related changes.  This also removes the questionably-useful "turn a transmute into a field projection" part of instsimplify (which I added ages ago without an obvious need for it) since that would just put back the field projections that MCP807 is trying to ban.

r? mir-opt
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
0 files changed, 0 insertions, 0 deletions