-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
[IndVars] Incorrect comparison folding #56242
Labels
Comments
I believe https://reviews.llvm.org/D101829 previously tried to fix this issue, but the fix is incomplete. Here the incoming phi block is loop.latch, and |
Candidate patch: https://reviews.llvm.org/D128640 |
EugeneZelenko
added
llvm:optimizations
llvm:SCEV
Scalar Evolution
and removed
new issue
llvm:optimizations
labels
Jun 27, 2022
nikic
added a commit
to rust-lang/llvm-project
that referenced
this issue
Jul 5, 2022
…R56242) When trying to prove an implied condition on a phi by proving it for all incoming values, we need to be careful about values coming from a backedge, as these may refer to a previous loop iteration. A variant of this issue was fixed in D101829, but the dominance condition used there isn't quite right: It checks that the value dominates the incoming block, which doesn't exclude backedges (values defined in a loop will usually dominate the loop latch, which is the incoming block of the backedge). Instead, we should be checking for domination of the phi block. Any values defined inside the loop will not dominate the loop header phi. Fixes llvm#56242. Differential Revision: https://reviews.llvm.org/D128640 (cherry picked from commit e4d1d0c)
Mark-Simulacrum
pushed a commit
to rust-lang/llvm-project
that referenced
this issue
Jul 9, 2022
…R56242) When trying to prove an implied condition on a phi by proving it for all incoming values, we need to be careful about values coming from a backedge, as these may refer to a previous loop iteration. A variant of this issue was fixed in D101829, but the dominance condition used there isn't quite right: It checks that the value dominates the incoming block, which doesn't exclude backedges (values defined in a loop will usually dominate the loop latch, which is the incoming block of the backedge). Instead, we should be checking for domination of the phi block. Any values defined inside the loop will not dominate the loop header phi. Fixes llvm#56242. Differential Revision: https://reviews.llvm.org/D128640 (cherry picked from commit e4d1d0c)
sveitser
added a commit
to EspressoSystems/cape
that referenced
this issue
Jul 18, 2022
Version 20220717 includes a fix for llvm/llvm-project#56242
sveitser
added a commit
to EspressoSystems/cape
that referenced
this issue
Jul 19, 2022
* Temporarily switch to nightly rust Version 20220717 includes a fix for llvm/llvm-project#56242 * Make clippy happy - Fix most lints. - Allow a few tedious and false positive lints. * rust latest -> 2022-07-17
bmwiedemann
pushed a commit
to bmwiedemann/openSUSE
that referenced
this issue
Sep 8, 2022
https://build.opensuse.org/request/show/1001713 by user aaronpuchert + dimstar_suse - Make sure we keep -DNDEBUG. At some point %{optflags} must have lost it, perhaps because CMake usually adds it on top. So when overriding CMAKE_{C,CXX}_FLAGS_RELWITHDEBINFO, we make sure to take over the other flags. We drop LLVM_ENABLE_ASSERTIONS=OFF, because that's the default anyway and hasn't helped here. - Add llvm-scev-fix-isImpliedViaMerge.patch: fixes a miscompilation caused by mixing up values of the current and previous iteration. (See gh#llvm/llvm-project#56242.)
mem-frob
pushed a commit
to draperlaboratory/hope-llvm-project
that referenced
this issue
Oct 7, 2022
…R56242) When trying to prove an implied condition on a phi by proving it for all incoming values, we need to be careful about values coming from a backedge, as these may refer to a previous loop iteration. A variant of this issue was fixed in D101829, but the dominance condition used there isn't quite right: It checks that the value dominates the incoming block, which doesn't exclude backedges (values defined in a loop will usually dominate the loop latch, which is the incoming block of the backedge). Instead, we should be checking for domination of the phi block. Any values defined inside the loop will not dominate the loop header phi. Fixes llvm/llvm-project#56242. Differential Revision: https://reviews.llvm.org/D128640
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the following test (https://llvm.godbolt.org/z/rT64Yb1K6),
-indvars
currently folds%cmp2
tofalse
:This is incorrect: While we have a guard that
%v > 0
, the value of%v
in the%prev
phi comes from the previous iteration, so the used context is incorrect.The text was updated successfully, but these errors were encountered: