-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
loop fails to increment counter #30594
Labels
bug
Indicates an unexpected problem or unintended behavior
compiler:optimizer
Optimization passes (mostly in base/compiler/ssair/)
Comments
Seems like this could be an optimizer issue. @Keno ? |
yeah looks like a bug in mutable struct sroa maybe? |
Keno
added
bug
Indicates an unexpected problem or unintended behavior
compiler:optimizer
Optimization passes (mostly in base/compiler/ssair/)
labels
Jan 4, 2019
Keno
added a commit
that referenced
this issue
Jan 5, 2019
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce.
Keno
added a commit
that referenced
this issue
Jan 5, 2019
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce.
Keno
added a commit
that referenced
this issue
Jan 6, 2019
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce.
KristofferC
pushed a commit
that referenced
this issue
Jan 9, 2019
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce. (cherry picked from commit f8f2045)
KristofferC
pushed a commit
that referenced
this issue
Jan 11, 2019
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce. (cherry picked from commit f8f2045)
Fixed by #30598 (?) |
yes |
KristofferC
pushed a commit
that referenced
this issue
Feb 4, 2019
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce. (cherry picked from commit f8f2045)
KristofferC
pushed a commit
that referenced
this issue
Feb 4, 2019
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce. (cherry picked from commit f8f2045)
KristofferC
pushed a commit
that referenced
this issue
Feb 11, 2019
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce. (cherry picked from commit f8f2045)
KristofferC
pushed a commit
that referenced
this issue
Feb 11, 2019
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce. (cherry picked from commit f8f2045)
KristofferC
pushed a commit
that referenced
this issue
Apr 20, 2019
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce. (cherry picked from commit f8f2045)
KristofferC
pushed a commit
that referenced
this issue
Feb 20, 2020
PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce. (cherry picked from commit f8f2045)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Indicates an unexpected problem or unintended behavior
compiler:optimizer
Optimization passes (mostly in base/compiler/ssair/)
When running a simple for loop, the contents of a counter changes depending on the presence (and location) of a println() in the loop. If the println() is above the line modifying the counter, the line modifying the counter has no effect (optimized out?), and the counter's value does not change during the loop. If the println() is below the modification, the variable changes as expected. I have an earlier (and larger) example that passes the counter to a different (non-println()) function below the modification, and that also produces the error.
This behavior reproduces in 1.0.1, 0.7.0, and RC 1.1. This behavior does not reproduce in 0.6.2. (All versions checked were generic 64-bit binaries under Ubuntu 18.04.1 LTS.)
Note there are two fixes to the issue: add a println() after the variable increment inside the loop, or change the '+' method so it does not use copy().
sample bad output:
sample good output (with second println() uncommented):
The text was updated successfully, but these errors were encountered: