public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98602] New: Failure to optimise vector “x > -100 ? x : -100” to MAX_EXPR
@ 2021-01-08 13:22 rsandifo at gcc dot gnu.org
  2021-01-08 13:48 ` [Bug tree-optimization/98602] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2021-01-08 13:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98602
           Summary: Failure to optimise vector “x > -100 ? x : -100” to
                    MAX_EXPR
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---

We don't fold:

  typedef int v4si __attribute__ ((vector_size(16)));
  v4si f (v4si x) { return x > -100 ? x : -100; }

to a MAX_EXPR, even though we do if -100 is replaced with a
nonnegative constant or a variable.  This may be related to
the remaining part of PR95906.

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

* [Bug tree-optimization/98602] Failure to optimise vector “x > -100 ? x : -100” to MAX_EXPR
  2021-01-08 13:22 [Bug tree-optimization/98602] New: Failure to optimise vector “x > -100 ? x : -100” to MAX_EXPR rsandifo at gcc dot gnu.org
@ 2021-01-08 13:48 ` rguenth at gcc dot gnu.org
  2021-01-11 18:04 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-08 13:48 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-01-08

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Guess we miss folders for this since it is represented as VEC_COND_EXPR from
the start (the testcase only builds with the C++ frontend) and scalar MIN/MAX
are usually detected by phiopt.  Ah, fold_cond_expr_with_comparison doesn't
handle adjusted constants:

return <retval> =  VEC_COND_EXPR < x >= { -99, -99, -99, -99 } , x , { -100,
-100, -100, -100 } > ;

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

* [Bug tree-optimization/98602] Failure to optimise vector “x > -100 ? x : -100” to MAX_EXPR
  2021-01-08 13:22 [Bug tree-optimization/98602] New: Failure to optimise vector “x > -100 ? x : -100” to MAX_EXPR rsandifo at gcc dot gnu.org
  2021-01-08 13:48 ` [Bug tree-optimization/98602] " rguenth at gcc dot gnu.org
@ 2021-01-11 18:04 ` cvs-commit at gcc dot gnu.org
  2021-06-29  6:38 ` pinskia at gcc dot gnu.org
  2021-06-29  6:43 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-11 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Sandiford <rsandifo@gcc.gnu.org>:

https://gcc.gnu.org/g:48c7f5b88116c894d76209db0f47216ed5ccd333

commit r11-6595-g48c7f5b88116c894d76209db0f47216ed5ccd333
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Mon Jan 11 18:03:21 2021 +0000

    aarch64: Add support for unpacked SVE mult, max and min

    This patch makes the SVE_INT_BINARY_IMM patterns support
    unpacked arithmetic, covering MUL, SMAX, SMIN, UMAX and UMIN.
    For min and max, the type suffix must be taken from the element
    size rather than the container size.

    The XFAILs are due to PR98602.

    gcc/
            * config/aarch64/aarch64-sve.md (<SVE_INT_BINARY_IMM:optab><mode>3)
            (@aarch64_pred_<SVE_INT_BINARY_IMM:optab><mode>)
            (*post_ra_<SVE_INT_BINARY_IMM:optab><mode>3): Extend from
SVE_FULL_I
            to SVE_I.

    gcc/testsuite/
            PR testsuite/98602
            * g++.target/aarch64/sve/max_1.C: New test.
            * g++.target/aarch64/sve/min_1.C: Likewise.
            * gcc.target/aarch64/sve/mul_2.c: Likewise.

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

* [Bug tree-optimization/98602] Failure to optimise vector “x > -100 ? x : -100” to MAX_EXPR
  2021-01-08 13:22 [Bug tree-optimization/98602] New: Failure to optimise vector “x > -100 ? x : -100” to MAX_EXPR rsandifo at gcc dot gnu.org
  2021-01-08 13:48 ` [Bug tree-optimization/98602] " rguenth at gcc dot gnu.org
  2021-01-11 18:04 ` cvs-commit at gcc dot gnu.org
@ 2021-06-29  6:38 ` pinskia at gcc dot gnu.org
  2021-06-29  6:43 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-06-29  6:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org
           Severity|normal                      |enhancement
                 CC|                            |pinskia at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I might get to this one when I move minmax_replacement from phiopt to match.pd.

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

* [Bug tree-optimization/98602] Failure to optimise vector “x > -100 ? x : -100” to MAX_EXPR
  2021-01-08 13:22 [Bug tree-optimization/98602] New: Failure to optimise vector “x > -100 ? x : -100” to MAX_EXPR rsandifo at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-06-29  6:38 ` pinskia at gcc dot gnu.org
@ 2021-06-29  6:43 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-06-29  6:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|pinskia at gcc dot gnu.org         |unassigned at gcc dot gnu.org
             Status|ASSIGNED                    |NEW

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Actually I am not going to handle this as the important parts of
fold_cond_expr_with_comparison have been ported already to match.pd.
But need extending for vector cases.

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

end of thread, other threads:[~2021-06-29  6:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 13:22 [Bug tree-optimization/98602] New: Failure to optimise vector “x > -100 ? x : -100” to MAX_EXPR rsandifo at gcc dot gnu.org
2021-01-08 13:48 ` [Bug tree-optimization/98602] " rguenth at gcc dot gnu.org
2021-01-11 18:04 ` cvs-commit at gcc dot gnu.org
2021-06-29  6:38 ` pinskia at gcc dot gnu.org
2021-06-29  6:43 ` 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).