public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/115299] New: [14 regression] pr86722.c failed to eliminate branch.
@ 2024-05-31  5:09 liuhongt at gcc dot gnu.org
  2024-05-31  5:32 ` [Bug target/115299] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2024-05-31  5:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115299
           Summary: [14 regression] pr86722.c failed to eliminate branch.
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, needs-bisection
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liuhongt at gcc dot gnu.org
  Target Milestone: ---
            Target: x86_64-*-* i?86-*-*

void f(double*d,double*e){
  for(;d<e;++d)
    *d=(*d<.5)?.7:0;
}


GCC14.1 -O2 generates

f:
        cmpq    %rsi, %rdi
        jnb     .L1
        movsd   .LC2(%rip), %xmm2
        movsd   .LC1(%rip), %xmm1
.L5:
        comisd  (%rdi), %xmm2
        movapd  %xmm1, %xmm0
        ja      .L3
        pxor    %xmm0, %xmm0
.L3:
        movsd   %xmm0, (%rdi)
        addq    $8, %rdi
        cmpq    %rsi, %rdi
        jb      .L5
.L1:
        ret

GCC12.3 -O2 

f:
        cmpq    %rsi, %rdi
        jnb     .L1
        movsd   .LC2(%rip), %xmm2
        movsd   .LC1(%rip), %xmm1
.L5:
        movsd   (%rdi), %xmm0
        addq    $8, %rdi
        cmpltsd %xmm2, %xmm0
        andpd   %xmm1, %xmm0
        movsd   %xmm0, -8(%rdi)
        cmpq    %rsi, %rdi
        jb      .L5
.L1:
        ret

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

* [Bug target/115299] [14 regression] pr86722.c failed to eliminate branch.
  2024-05-31  5:09 [Bug target/115299] New: [14 regression] pr86722.c failed to eliminate branch liuhongt at gcc dot gnu.org
@ 2024-05-31  5:32 ` pinskia at gcc dot gnu.org
  2024-05-31  5:32 ` [Bug target/115299] [14/15 " pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-31  5:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-05-31
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
ce differences:

13:
```
========== Pass 2 ==========

IF-THEN-JOIN block found, pass 2, test 4, then 6, join 7
scanning new insn with uid = 68.
scanning new insn with uid = 69.
scanning new insn with uid = 70.
scanning new insn with uid = 71.
scanning new insn with uid = 72.
scanning new insn with uid = 73.
Removing jump 14.
deleting insn with uid = 14.
deleting insn with uid = 5.
deleting block 6
Conversion succeeded on pass 2.

```


14/trunk:
```

IF-THEN-JOIN block found, pass 2, test 4, then 6, join 7


========== no more changes

3 possible IF blocks searched.
1 IF blocks converted.
1 true changes made.

```

Maybe r14-53-g675b1a7f113adb .

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

* [Bug target/115299] [14/15 regression] pr86722.c failed to eliminate branch.
  2024-05-31  5:09 [Bug target/115299] New: [14 regression] pr86722.c failed to eliminate branch liuhongt at gcc dot gnu.org
  2024-05-31  5:32 ` [Bug target/115299] " pinskia at gcc dot gnu.org
@ 2024-05-31  5:32 ` pinskia at gcc dot gnu.org
  2024-05-31  5:47 ` liuhongt at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-31  5:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.2
            Summary|[14 regression] pr86722.c   |[14/15 regression]
                   |failed to eliminate branch. |pr86722.c failed to
                   |                            |eliminate branch.

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

* [Bug target/115299] [14/15 regression] pr86722.c failed to eliminate branch.
  2024-05-31  5:09 [Bug target/115299] New: [14 regression] pr86722.c failed to eliminate branch liuhongt at gcc dot gnu.org
  2024-05-31  5:32 ` [Bug target/115299] " pinskia at gcc dot gnu.org
  2024-05-31  5:32 ` [Bug target/115299] [14/15 " pinskia at gcc dot gnu.org
@ 2024-05-31  5:47 ` liuhongt at gcc dot gnu.org
  2024-06-03  7:18 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2024-05-31  5:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
> Maybe r14-53-g675b1a7f113adb .

Probably, current cost model may need adjustment.

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

* [Bug target/115299] [14/15 regression] pr86722.c failed to eliminate branch.
  2024-05-31  5:09 [Bug target/115299] New: [14 regression] pr86722.c failed to eliminate branch liuhongt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-05-31  5:47 ` liuhongt at gcc dot gnu.org
@ 2024-06-03  7:18 ` cvs-commit at gcc dot gnu.org
  2024-06-03  7:20 ` liuhongt at gcc dot gnu.org
  2024-06-04  2:16 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-03  7:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>:

https://gcc.gnu.org/g:ac306de7d5100d3682eae2270995a9abbe19db38

commit r15-984-gac306de7d5100d3682eae2270995a9abbe19db38
Author: liuhongt <hongtao.liu@intel.com>
Date:   Fri May 31 14:38:07 2024 +0800

    Add some preference for floating point rtl ifcvt when sse4.1 is not
available

    W/o TARGET_SSE4_1, it takes 3 instructions (pand, pandn and por) for
    movdfcc/movsfcc, and could possibly fail cost comparison. Increase
    branch cost could hurt performance for other modes, so specially add
    some preference for floating point ifcvt.

    gcc/ChangeLog:

            PR target/115299
            * config/i386/i386.cc (ix86_noce_conversion_profitable_p): Add
            some preference for floating point ifcvt when SSE4.1 is not
            available.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr115299.c: New test.
            * gcc.target/i386/pr86722.c: Adjust testcase.

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

* [Bug target/115299] [14/15 regression] pr86722.c failed to eliminate branch.
  2024-05-31  5:09 [Bug target/115299] New: [14 regression] pr86722.c failed to eliminate branch liuhongt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-06-03  7:18 ` cvs-commit at gcc dot gnu.org
@ 2024-06-03  7:20 ` liuhongt at gcc dot gnu.org
  2024-06-04  2:16 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2024-06-03  7:20 UTC (permalink / raw)
  To: gcc-bugs

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

Hongtao Liu <liuhongt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
Fixed in GCC15

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

* [Bug target/115299] [14/15 regression] pr86722.c failed to eliminate branch.
  2024-05-31  5:09 [Bug target/115299] New: [14 regression] pr86722.c failed to eliminate branch liuhongt at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-06-03  7:20 ` liuhongt at gcc dot gnu.org
@ 2024-06-04  2:16 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-04  2:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>:

https://gcc.gnu.org/g:4d207044195b97ecb27c72a7dc987eb8b86644a0

commit r15-1003-g4d207044195b97ecb27c72a7dc987eb8b86644a0
Author: liuhongt <hongtao.liu@intel.com>
Date:   Tue Jun 4 10:13:09 2024 +0800

    Adjust testcase for -march=cascadelake

    gcc/testsuite/ChangeLog:

            PR target/115299
            * gcc.target/i386/pr86722.c: Also scan for blendvpd.

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

end of thread, other threads:[~2024-06-04  2:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-31  5:09 [Bug target/115299] New: [14 regression] pr86722.c failed to eliminate branch liuhongt at gcc dot gnu.org
2024-05-31  5:32 ` [Bug target/115299] " pinskia at gcc dot gnu.org
2024-05-31  5:32 ` [Bug target/115299] [14/15 " pinskia at gcc dot gnu.org
2024-05-31  5:47 ` liuhongt at gcc dot gnu.org
2024-06-03  7:18 ` cvs-commit at gcc dot gnu.org
2024-06-03  7:20 ` liuhongt at gcc dot gnu.org
2024-06-04  2:16 ` cvs-commit 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).