public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/35346]  New: Scalar replacement -- handling of conditional generator -- missing
@ 2008-02-24  4:47 xinliangli at gmail dot com
  2008-02-24 21:52 ` [Bug middle-end/35346] " rguenth at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: xinliangli at gmail dot com @ 2008-02-24  4:47 UTC (permalink / raw)
  To: gcc-bugs

// David Li:

Conditional generator is not handled, missing redundancy elimination for a[i]
and a[i-1]

int a[1000];
int b[1000];

void foo(int n)
{
   int i = 1;
   for(; i < n; i++)
   {
        if (b[i] > 0)
            a[i+1] = a[i-1];
        b[i] = a[i];
   }
}

==> should be (similar to PRE)

Conditional generator is not handled, missing redundancy elimination for a[i]
and a[i-1]

int a[1000];
int b[1000];

t1 = a[0];
t2 = a[1];
void foo(int n)
{
   int i = 1;
   for(; i < n; i++)
   {

        if (b[i] > 0)
        {
            t3 = t1;
            a[i+1] = t3;
        }
        else t3 = a[i+1];

        b[i] = t2;
        t1 = t2;
        t2 = t3;
   }
}
(Loop can be unrolled to reduce copy)


-- 
           Summary: Scalar replacement -- handling of conditional generator
                    -- missing
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: xinliangli at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35346


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

* [Bug middle-end/35346] Scalar replacement -- handling of conditional generator -- missing
  2008-02-24  4:47 [Bug middle-end/35346] New: Scalar replacement -- handling of conditional generator -- missing xinliangli at gmail dot com
@ 2008-02-24 21:52 ` rguenth at gcc dot gnu dot org
  2008-04-07  1:38 ` pinskia at gcc dot gnu dot org
  2008-12-29  6:18 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-24 21:52 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
           Keywords|                            |missed-optimization
            Version|unknown                     |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35346


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

* [Bug middle-end/35346] Scalar replacement -- handling of conditional generator -- missing
  2008-02-24  4:47 [Bug middle-end/35346] New: Scalar replacement -- handling of conditional generator -- missing xinliangli at gmail dot com
  2008-02-24 21:52 ` [Bug middle-end/35346] " rguenth at gcc dot gnu dot org
@ 2008-04-07  1:38 ` pinskia at gcc dot gnu dot org
  2008-12-29  6:18 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-04-07  1:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-04-07 01:37 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-04-07 01:37:59
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35346


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

* [Bug middle-end/35346] Scalar replacement -- handling of conditional generator -- missing
  2008-02-24  4:47 [Bug middle-end/35346] New: Scalar replacement -- handling of conditional generator -- missing xinliangli at gmail dot com
  2008-02-24 21:52 ` [Bug middle-end/35346] " rguenth at gcc dot gnu dot org
  2008-04-07  1:38 ` pinskia at gcc dot gnu dot org
@ 2008-12-29  6:18 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29  6:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-12-29 06:15 -------
Hmm:
MEM[symbol: b, index: ivtmp.27, step: 4, offset: 4294967292]

Why do we produce a step and an offset when they cancel?

If we change the store to a[i+1] to be unconditional, predictive commoning does
the correct thing.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2008-04-07 01:37:59         |2008-12-29 06:15:08
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35346


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

end of thread, other threads:[~2008-12-29  6:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-24  4:47 [Bug middle-end/35346] New: Scalar replacement -- handling of conditional generator -- missing xinliangli at gmail dot com
2008-02-24 21:52 ` [Bug middle-end/35346] " rguenth at gcc dot gnu dot org
2008-04-07  1:38 ` pinskia at gcc dot gnu dot org
2008-12-29  6:18 ` pinskia at gcc dot gnu dot 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).