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
{{ message }}
Repository navigation
Missed optimization with core::cmp::{min,max} {<,>} n and the range of one the values is known #92967
Activity
nikic commentedon Jan 16, 2022
Godbolt: https://rust.godbolt.org/z/78sGo6na7 Still doesn't optimize on LLVM head: https://llvm.godbolt.org/z/nTPM51W7K
It looks like LVI currently only handles the case where both sides of the min/max have a known range: https://github.com/llvm/llvm-project/blob/30a4020a7db866990199f523a60ad474d7ec3efa/llvm/lib/Analysis/LazyValueInfo.cpp#L810 Should be easy to fix at least.
nikic commentedon Jan 18, 2022
Should be fixed by llvm/llvm-project@202d590, llvm/llvm-project@d15823e, llvm/llvm-project@9e68557.
paolobarbolini commentedon Feb 19, 2022
I was able to confirm that #93577 fixed it
https://rust.godbolt.org/z/o6bqsKEjs
Closing