You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: I've been looking at layout and pondering whether we need separate unchecked methods, or can just trust LLVM to optimize to the same things anyway when unwrap_unchecked is used.
Original Rust example: https://rust.godbolt.org/z/xze3vEx8E
Actual output (-) and what I'd hope to get instead (+):
Note that
%_11 sgt -1
, thanks to the range attribute on the%0
parameter.Alive proof that this is allowed: https://alive2.llvm.org/ce/z/Dn2P8R
Repro that more
opt
on trunk doesn't do it: https://llvm.godbolt.org/z/Kr8n37s41Oh, turns out the simpler case of just
doesn't add the
nsw
either.And that'd be allowed too: https://alive2.llvm.org/ce/z/PeC7No
Context: I've been looking at layout and pondering whether we need separate unchecked methods, or can just trust LLVM to optimize to the same things anyway when
unwrap_unchecked
is used.PRs like rust-lang/rust#136575 have me thinking about
nuw
/nsw
.The text was updated successfully, but these errors were encountered: