Skip to content

Commit 10275a5

Browse files
committed
Auto merge of #151622 - scottmcm:elide-more-transmutes, r=cjgillot
GVN: Elide more intermediate transmutes We already skipped intermediate steps like `u32` or `i32` that support any (initialized) value. This extends that to also allow skipping intermediate steps whose values are a superset of either the source or destination type. Most importantly, that means that `usize` → `NonZeroUsize` → `ptr::Alignment` and `ptr::Alignment` → `NonZeroUsize` → `usize` can skip the middle because `NonZeroUsize` is a superset of `Alignment`. Then `Alignment::as_usize` is updated to take advantage of that and let us remove some more locals in a few places. r? cjgillot
2 parents e4f1992 + 7297107 commit 10275a5

0 file changed

File tree

    0 commit comments

    Comments
     (0)