public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tnfchris at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/114403] [14 regression] LLVM miscompiled with -O3 -march=znver2 -fno-vect-cost-model since r14-6822-g01f4251b8775c8
Date: Tue, 02 Apr 2024 16:41:37 +0000	[thread overview]
Message-ID: <bug-114403-4-Ha9KPOSwtw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114403-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #20 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
This is a bad interaction with early break and peeling for gaps.

when peeling for gaps we set bias_for_lowest to 0, which then negates the ceil
for the upper bound calculation when the div is exact.

We end up doing on a loop that does:

Analyzing # of iterations of loop 1
  exit condition [8, + , 18446744073709551615] != 0
  bounds on difference of bases: -8 ... -8
  result:
    # of iterations 8, bounded by 8

and a VF=4 calculating:

Loop 1 iterates at most 1 times.
Loop 1 likely iterates at most 1 times.
Analyzing # of iterations of loop 1
  exit condition [1, + , 1](no_overflow) < bnd.5505_39
  bounds on difference of bases: 0 ... 4611686018427387902
Matching expression match.pd:2011, generic-match-8.cc:27
Applying pattern match.pd:2067, generic-match-1.cc:4813
  result:
    # of iterations bnd.5505_39 + 18446744073709551615, bounded by
4611686018427387902
Estimating sizes for loop 1
...
   Induction variable computation will be folded away.
  size:   2 if (ivtmp_312 < bnd.5505_39)
   Exit condition will be eliminated in last copy.
size: 24-3, last_iteration: 24-5
  Loop size: 24
  Estimated size after unrolling: 26
;; Guessed iterations of loop 1 is 0.858446. New upper bound 1.

upper bound should be 2 not 1. I have a working patch, trying to create a
standalone testcase for it.

  parent reply	other threads:[~2024-04-02 16:41 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 10:44 [Bug tree-optimization/114403] New: [14 regression] sjames at gcc dot gnu.org
2024-03-20 10:44 ` [Bug tree-optimization/114403] [14 regression] LLVM miscompiled with -O3 -march=znver2 -fno-vect-cost-model sjames at gcc dot gnu.org
2024-03-20 10:53 ` sjames at gcc dot gnu.org
2024-03-20 11:49 ` rguenth at gcc dot gnu.org
2024-03-20 17:23 ` [Bug tree-optimization/114403] [14 regression] LLVM miscompiled with -O3 -march=znver2 -fno-vect-cost-model since r14-6822-g01f4251b8775c8 sjames at gcc dot gnu.org
2024-03-20 21:27 ` sjames at gcc dot gnu.org
2024-03-21  3:23 ` sjames at gcc dot gnu.org
2024-03-22  9:47 ` sjames at gcc dot gnu.org
2024-03-22  9:50 ` sjames at gcc dot gnu.org
2024-03-22 10:56 ` sjames at gcc dot gnu.org
2024-03-22 11:26 ` rguenth at gcc dot gnu.org
2024-03-22 12:36 ` law at gcc dot gnu.org
2024-03-22 13:12 ` sjames at gcc dot gnu.org
2024-03-22 13:13 ` sjames at gcc dot gnu.org
2024-03-22 13:13 ` sjames at gcc dot gnu.org
2024-03-22 13:27 ` sjames at gcc dot gnu.org
2024-03-22 13:50 ` rguenth at gcc dot gnu.org
2024-03-22 13:52 ` rguenth at gcc dot gnu.org
2024-03-22 14:27 ` sjames at gcc dot gnu.org
2024-03-22 14:37 ` sjames at gcc dot gnu.org
2024-03-26 10:09 ` rguenth at gcc dot gnu.org
2024-04-02 13:26 ` tnfchris at gcc dot gnu.org
2024-04-02 16:41 ` tnfchris at gcc dot gnu.org [this message]
2024-04-11 21:40 ` tnfchris at gcc dot gnu.org
2024-04-11 21:52 ` tnfchris at gcc dot gnu.org
2024-04-12 10:12 ` rguenth at gcc dot gnu.org
2024-04-12 10:15 ` tnfchris at gcc dot gnu.org
2024-04-12 10:37 ` rguenth at gcc dot gnu.org
2024-04-12 10:40 ` tnfchris at gcc dot gnu.org
2024-04-12 11:27 ` rguenth at gcc dot gnu.org
2024-04-15 11:07 ` cvs-commit at gcc dot gnu.org
2024-04-15 11:08 ` tnfchris at gcc dot gnu.org
2024-04-16 19:56 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114403-4-Ha9KPOSwtw@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).