public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103278] New: [12 Regression] Recent change to cddce inhibits switch optimization
@ 2021-11-16 17:16 law at gcc dot gnu.org
  2021-11-16 23:25 ` [Bug tree-optimization/103278] " pinskia at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: law at gcc dot gnu.org @ 2021-11-16 17:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103278
           Summary: [12 Regression] Recent change to cddce inhibits switch
                    optimization
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at gcc dot gnu.org
  Target Milestone: ---

On iq2000-elf this change:

commit 045206450386bcd774db3bde0c696828402361c6
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Nov 12 10:21:22 2021 +0100

    tree-optimization/102880 - improve CD-DCE
[ ... ]

Is inhibiting switch optimization for tree-ssa/if-to-switch-3.c from converting
an if statement into a switch statement:

/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-iftoswitch-optimized" } */

int IsMySuperRandomChar(int aChar)
{
  return aChar == 0x0009 || aChar == 0x000A ||
         aChar == 0x000C || aChar == 0x000D ||
         aChar == 0x0020 || aChar == 0x0030;
}

/* { dg-final { scan-tree-dump "Condition chain with \[^\n\r]\* BBs transformed
into a switch statement." "iftoswitch" } } */


After today's cd-dce change we no longer turn that into a switch:

Before:

;; Canonical GIMPLE case clusters: 9-10 12 13 32 48
;; JT can be built: JT(values:6 comparisons:10 range:40 density: 25.00%):9-48
j.c:8:26: optimized: Condition chain with 3 BBs transformed into a switch
statement.


After:
;; Canonical GIMPLE case clusters: 9-10 12-13 32 48

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

end of thread, other threads:[~2021-11-30 13:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 17:16 [Bug tree-optimization/103278] New: [12 Regression] Recent change to cddce inhibits switch optimization law at gcc dot gnu.org
2021-11-16 23:25 ` [Bug tree-optimization/103278] " pinskia at gcc dot gnu.org
2021-11-16 23:29 ` pinskia at gcc dot gnu.org
2021-11-17 14:48 ` law at gcc dot gnu.org
2021-11-18  7:36 ` rguenth at gcc dot gnu.org
2021-11-18  8:48 ` rguenth at gcc dot gnu.org
2021-11-18  9:02 ` cvs-commit at gcc dot gnu.org
2021-11-18  9:04 ` rguenth at gcc dot gnu.org
2021-11-23  3:31 ` law at gcc dot gnu.org
2021-11-23  8:23 ` rguenth at gcc dot gnu.org
2021-11-23  8:25 ` marxin at gcc dot gnu.org
2021-11-29 15:23 ` marxin at gcc dot gnu.org
2021-11-30  7:22 ` rguenther at suse dot de
2021-11-30 13:48 ` cvs-commit at gcc dot gnu.org
2021-11-30 13:48 ` marxin 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).