-
Notifications
You must be signed in to change notification settings - Fork 13.5k
nuw nsw
not deduced for add 1
inbounds of range-restricted length
#87854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It has been supported by CVP: https://godbolt.org/z/ezdrzn4Yv. Did you mean: https://alive2.llvm.org/ce/z/xNoymj
|
I guess so? I don't know enough about phase ordering to say confidently whether CVP can actually handle the scenario I was hitting, just that running the normal O3 passes on the provided source IR doesn't give me an output with |
This patch uses `getConstantRangeAtUse` to infer nsw/nuw flags with at-use info. It will enables more optimizations in InstCombine. Compile-time impact: http://llvm-compile-time-tracker.com/compare.php?from=a5ed14bc8e122fa5ac0aa81f8d8390931bd6b4e4&to=a83d3402b663439b91cb37a046fb7ac0220ba5c7&stat=instructions%3Au Related issue: #87854
This patch uses `getConstantRangeAtUse` to infer nsw/nuw flags with at-use info. It will enables more optimizations in InstCombine. Compile-time impact: http://llvm-compile-time-tracker.com/compare.php?from=a5ed14bc8e122fa5ac0aa81f8d8390931bd6b4e4&to=a83d3402b663439b91cb37a046fb7ac0220ba5c7&stat=instructions%3Au Related issue: llvm#87854
Closed as there is little benefit to use block value in CVP.
|
(Context: I tried adding
assume
s to slice lengths in rust -- rust-lang/rust#122926 -- and was surprised that certain things didn't optimize away that I would have expected to. The example here is basicallyif i < slice.len() { do_something_with(i + 1); })
.)I tried the following: https://llvm.godbolt.org/z/qM5bnMxxj
expecting to see the
add
becomeadd nuw nsw
because of the range restriction on%x.1
, but it doesn't.Alive proof that it would be ok to do so here: https://alive2.llvm.org/ce/z/3jHXNu
The text was updated successfully, but these errors were encountered: