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
It would be nice if LLVM could -- when element_size is a constant, as it often ends up being in templated code -- move the check before the multiplication so that the overflow handling could be removed, and it just be a normal multiplication instead. (Perhaps even an nuw one, by sinking it into the branch that cares about the result.)
A bunch of containers have code enforcing object size limits that ends up looking like
in Rust, or in C++ something like
It would be nice if LLVM could -- when
element_size
is a constant, as it often ends up being in templated code -- move the check before the multiplication so that the overflow handling could be removed, and it just be a normal multiplication instead. (Perhaps even annuw
one, by sinking it into the branch that cares about the result.)An example in Alive2: https://alive2.llvm.org/ce/z/X9ipzy
(It's based on https://rust.godbolt.org/z/47WWG4b4T, which was inspired by rust-lang/rust#118228.)
This issue is basically the same as #56563 but for
umul.with.overflow
rather than for ordinarymul
.The text was updated successfully, but these errors were encountered: