nuw
being lost when optimizing sub
to add
leads to worse codegen
#53377
Labels
nuw
being lost when optimizing sub
to add
leads to worse codegen
#53377
See the problem on godbolt. In this code:
running through
opt
causes thesub
to be switched out forNote that the
nuw
flag was lost. This causes the compiled assembly to include an extra instruction. Originally found in rust-lang/rust#91449 .Alive2 actually indicates that the
nuw
flag would be incorrect here, which makes sense since -10 is secretly just 246. Is there another way to address this? I can close this issue if the only reasonable response is "yeah, canonicalization requires us to do this, and sometimes that causes problems. Sorry"The text was updated successfully, but these errors were encountered: