diff options
author | Tamar Christina <tamar.christina@arm.com> | 2024-02-14 16:13:51 +0000 |
---|---|---|
committer | Tamar Christina <tamar.christina@arm.com> | 2024-02-14 16:13:51 +0000 |
commit | 16ae5efedd389e8952f35bb10665518c22a9251c (patch) | |
tree | 25e22cdd2fe21453af2e8325e256ed6a5db185a0 /libgcc | |
parent | b79d3e6a9284703b70688122f7d4955e7c50804a (diff) | |
download | gcc-16ae5efedd389e8952f35bb10665518c22a9251c.zip gcc-16ae5efedd389e8952f35bb10665518c22a9251c.tar.gz gcc-16ae5efedd389e8952f35bb10665518c22a9251c.tar.bz2 |
middle-end: inspect all exits for additional annotations for loop.
Attaching a pragma to a loop which has a complex condition often gets the pragma
dropped. e.g.
#pragma GCC novector
while (i < N && parse_tables_n--)
before lowering this is represented as:
if (ANNOTATE_EXPR <i <= 305 && parse_tables_n-- != 0, no-vector>) ...
But after lowering the condition is broken appart and attached to the final
component of the expression:
if (parse_tables_n.2_2 != 0) goto <D.4456>; else goto <D.4453>;
<D.4456>:
iftmp.1D.4452 = 1;
goto <D.4454>;
<D.4453>:
iftmp.1D.4452 = 0;
<D.4454>:
D.4451 = .ANNOTATE (iftmp.1D.4452, 2, 0);
if (D.4451 != 0) goto <D.4442>; else goto <D.4440>;
<D.4440>:
and it's never heard from again because during replace_loop_annotate we only
inspect the loop header and latch for annotations.
Since annotations were supposed to apply to the loop as a whole this fixes it
by checking the loop exit src blocks for annotations instead.
gcc/ChangeLog:
* tree-cfg.cc (replace_loop_annotate): Inspect loop edges for annotations.
gcc/testsuite/ChangeLog:
* gcc.dg/vect/vect-novect_gcond.c: New test.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions