public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/114173] miss optimization of redundant load operation, may confused by type conversion
Date: Thu, 29 Feb 2024 22:44:06 +0000	[thread overview]
Message-ID: <bug-114173-4-p5WnE9DsxX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114173-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Trying 7, 8, 9 -> 10:
    7: r100:HI=zero_extend([const(`g_63'+0x10)])
    8: {r107:HI=r100:HI+0x1;clobber flags:CC;}
      REG_UNUSED flags:CC
    9: r108:SI=zero_extend(r107:HI)
      REG_DEAD r107:HI
   10: {r109:SI=r108:SI-0x1;clobber flags:CC;}
      REG_DEAD r108:SI
      REG_UNUSED flags:CC
Failed to match this instruction:
(parallel [
        (set (reg:SI 109 [ c_8 ])
            (zero_extend:SI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI
("g_63") [flags 0x2]  <var_decl 0x7f3809c10cf0 g_63>)
                            (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1
A128])))
        (clobber (reg:CC 17 flags))
        (set (reg:HI 100 [ _3 ])
            (zero_extend:HI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI
("g_63") [flags 0x2]  <var_decl 0x7f3809c10cf0 g_63>)
                            (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1
A128])))
    ])
Failed to match this instruction:
(parallel [
        (set (reg:SI 109 [ c_8 ])
            (zero_extend:SI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI
("g_63") [flags 0x2]  <var_decl 0x7f3809c10cf0 g_63>)
                            (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1
A128])))
        (set (reg:HI 100 [ _3 ])
            (zero_extend:HI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI
("g_63") [flags 0x2]  <var_decl 0x7f3809c10cf0 g_63>)
                            (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1
A128])))
    ])
Successfully matched this instruction:
(set (reg:HI 100 [ _3 ])
    (zero_extend:HI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI ("g_63") [flags
0x2]  <var_decl 0x7f3809c10cf0 g_63>)
                    (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1 A128])))
Successfully matched this instruction:
(set (reg:SI 109 [ c_8 ])
    (zero_extend:SI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI ("g_63") [flags
0x2]  <var_decl 0x7f3809c10cf0 g_63>)
                    (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1 A128])))
allowing combination of insns 7, 8, 9 and 10
original costs 9 + 4 + 4 + 4 = 21
replacement costs 9 + 9 = 18
deferring deletion of insn with uid = 8.
deferring deletion of insn with uid = 7.
modifying insn i2     9: r100:HI=zero_extend([const(`g_63'+0x10)])
deferring rescan insn with uid = 9.
modifying insn i3    10: r109:SI=zero_extend([const(`g_63'+0x10)])
deferring rescan insn with uid = 10.

      reply	other threads:[~2024-02-29 22:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 16:27 [Bug rtl-optimization/114173] New: " absoler at smail dot nju.edu.cn
2024-02-29 22:44 ` pinskia at gcc dot gnu.org [this message]

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-114173-4-p5WnE9DsxX@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).