public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/18940] Loop is not vectorized when it should be (VRP)
       [not found] <bug-18940-4@http.gcc.gnu.org/bugzilla/>
@ 2021-12-25 22:56 ` pinskia at gcc dot gnu.org
  2021-12-25 22:59 ` pinskia at gcc dot gnu.org
  2023-08-07  7:55 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-25 22:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18940

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |NEW

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is mostly fixed on the trunk.
What is left is:
  # RANGE [1, 1073741823] NONZERO 1073741823
  D1360_10 = n_9(D) >> 1;
...
  # RANGE [4, 4294967292] NONZERO 4294967295
  _18 = D1360_10 > 0 ? _19 : 4;

Notice how we have the range for D1360_10 but then don't optimize the COND_EXPR
....

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/18940] Loop is not vectorized when it should be (VRP)
       [not found] <bug-18940-4@http.gcc.gnu.org/bugzilla/>
  2021-12-25 22:56 ` [Bug tree-optimization/18940] Loop is not vectorized when it should be (VRP) pinskia at gcc dot gnu.org
@ 2021-12-25 22:59 ` pinskia at gcc dot gnu.org
  2023-08-07  7:55 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-25 22:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18940

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|53947                       |26731

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #5)
> Notice how we have the range for D1360_10 but then don't optimize the
> COND_EXPR ....

Which is the same problem as I mentioned in PR 26731.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26731
[Bug 26731] Jump threading gets in the way of loops
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/18940] Loop is not vectorized when it should be (VRP)
       [not found] <bug-18940-4@http.gcc.gnu.org/bugzilla/>
  2021-12-25 22:56 ` [Bug tree-optimization/18940] Loop is not vectorized when it should be (VRP) pinskia at gcc dot gnu.org
  2021-12-25 22:59 ` pinskia at gcc dot gnu.org
@ 2023-08-07  7:55 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-07  7:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18940

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 13.
DOM3 now optimizes it:

Optimizing statement _17 = D1360_10 > 0;
LKUP STMT _17 = D1360_10 gt_expr 0
2>>> STMT _17 = D1360_10 gt_expr 0
LKUP STMT D1360_10 le_expr 1
Optimizing statement _16 = (unsigned int) D1360_10;
LKUP STMT _16 = nop_expr D1360_10
2>>> STMT _16 = nop_expr D1360_10
Optimizing statement niters.3_18 = _17 ? _16 : 1;
  Replaced '_17' with constant '1'
 Registering value_relation (_16 pe32 D1360_10) (bb3) at _16 = (unsigned int)
D1360_10;
Applying pattern match.pd:4437, gimple-match.cc:176249
gimple_simplified to niters.3_18 = _16;
  Folded to: niters.3_18 = _16;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-07  7:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-18940-4@http.gcc.gnu.org/bugzilla/>
2021-12-25 22:56 ` [Bug tree-optimization/18940] Loop is not vectorized when it should be (VRP) pinskia at gcc dot gnu.org
2021-12-25 22:59 ` pinskia at gcc dot gnu.org
2023-08-07  7:55 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).