public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Missed optimization in PRE?
@ 2012-03-29 10:02 Bin.Cheng
  2012-03-29 10:07 ` Richard Guenther
  0 siblings, 1 reply; 15+ messages in thread
From: Bin.Cheng @ 2012-03-29 10:02 UTC (permalink / raw)
  To: gcc

Hi,
Following is the tree dump of 094t.pre for a test program.
Question is loads of D.5375_12/D.5375_14 are redundant on path <bb2,
bb7, bb5, bb6>,
but why not lowered into basic block 3, where it is used.

BTW, seems no tree pass handles this case currently.

Any idea? Thanks

  int z$imag;
  int z$real;
  int D.5378;
  int D.5377;
  int D.5376;
  int D.5375;

<bb 2>:
  D.5375_11 = REALPART_EXPR <g2>;
  D.5376_12 = IMAGPART_EXPR <g2>;
  D.5377_13 = REALPART_EXPR <g3>;
  D.5378_14 = IMAGPART_EXPR <g3>;
  if (D.5375_11 == D.5377_13)
    goto <bb 3>;
  else
    goto <bb 7>;

<bb 3>:
  if (D.5376_12 == D.5378_14)
    goto <bb 4>;
  else
    goto <bb 7>;

<bb 4>:
  z$real_15 = REALPART_EXPR <g1>;
  z$imag_16 = IMAGPART_EXPR <g1>;
  goto <bb 6>;

<bb 7>:

<bb 5>:
  z$real_17 = REALPART_EXPR <g4>;
  z$imag_18 = IMAGPART_EXPR <g4>;

<bb 6>:
  # z$real_19 = PHI <z$real_15(4), z$real_17(5)>
  # z$imag_20 = PHI <z$imag_16(4), z$imag_18(5)>
  REALPART_EXPR <g1> = z$real_19;
  IMAGPART_EXPR <g1> = z$imag_20;
  return 0;

-- 
Best Regards.

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

end of thread, other threads:[~2012-04-11 10:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-29 10:02 Missed optimization in PRE? Bin.Cheng
2012-03-29 10:07 ` Richard Guenther
2012-03-29 10:10   ` Bin.Cheng
2012-03-29 10:14     ` Richard Guenther
2012-03-29 10:22       ` Bin.Cheng
2012-03-29 15:25       ` Bin.Cheng
2012-03-30  8:16         ` Richard Guenther
2012-03-30  9:43           ` Bin.Cheng
2012-04-09  6:00             ` Bin.Cheng
2012-04-09 11:02               ` Richard Guenther
2012-04-11  3:28                 ` Bin.Cheng
2012-04-11  8:05                   ` Bin.Cheng
2012-04-11  9:09                     ` Richard Guenther
2012-04-11  9:25                       ` Bin.Cheng
2012-04-11 10:02                         ` Richard Guenther

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).