]> gcc.gnu.org Git - gcc.git/commit
Clean up loop variable extraction in OpenACC kernels loop annotation.
authorSandra Loosemore <sandra@codesourcery.com>
Sun, 30 Aug 2020 19:15:23 +0000 (12:15 -0700)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 21 Jun 2022 13:11:28 +0000 (14:11 +0100)
commitfba58e3021963676f4162ac013ccb6fa0218ed4c
tree28d70fc52da97c4d2d1e5c41d29ce02a55b41cda
parenta929984b858c4f8267f16460af2c39b9783cef2a
Clean up loop variable extraction in OpenACC kernels loop annotation.

The code for identifying annotatable loops in OpenACC kernels regions
previously looked for the loop variable as the left-hand side of the
comparison in the loop end test.  However, front end optimizations
sometimes switch the sense of the comparison, making this method
unreliable.  In particular, it's ambiguous when both operands to the
end test comparison are local variables.

This patch reorders the loop processing to identify the loop variable
from the initializer, rather than the end test. The processing of the
end test then just checks that one of the operands to the comparison
matches the variable appearing in the initializer.  Much of the patch
is code refactoring, moving the initializer analysis out of
annotate_for_loop to check_and_annotate_for_loop so it can be
performed earlier.

2020-08-30  Sandra Loosemore  <sandra@codesourcery.com>

gcc/c-family/
* c-omp.cc (annotate_for_loop): Move initializer processing...
(check_and_annotate_for_loop): ... to here.  Allow the loop
variable as either operand to the condition.
gcc/c-family/ChangeLog.omp
gcc/c-family/c-omp.cc
This page took 0.072401 seconds and 5 git commands to generate.