public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/10050] ifcvt is not smart enough
       [not found] <bug-10050-4@http.gcc.gnu.org/bugzilla/>
@ 2012-02-07 21:05 ` pinskia at gcc dot gnu.org
  2023-05-26  1:01 ` [Bug middle-end/10050] " pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-07 21:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-07 21:05:24 UTC ---
Note this optimized I think is invalid with the C11/C++11 memory model.


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

* [Bug middle-end/10050] ifcvt is not smart enough
       [not found] <bug-10050-4@http.gcc.gnu.org/bugzilla/>
  2012-02-07 21:05 ` [Bug rtl-optimization/10050] ifcvt is not smart enough pinskia at gcc dot gnu.org
@ 2023-05-26  1:01 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-26  1:01 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|rtl-optimization            |middle-end

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note for func2 we get:

  if (flag.0_2 != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 3>; [50.00%]

  <bb 3> [local count: 536870912]:
  pretmp_18 = *a_10(D);
  pretmp_20 = MEM[(int *)a_10(D) + 4B];
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 536870913]:
  *a_10(D) = _9;
  MEM[(int *)a_10(D) + 4B] = _1;

  <bb 5> [local count: 1073741824]:
  # prephitmp_19 = PHI <pretmp_18(3), _9(4)>
  # prephitmp_21 = PHI <pretmp_20(3), _1(4)>

the conditional stores are correct if not supplying -fallow-store-data-races . 
Now GCC does not optimize this even with -fallow-store-data-races but maybe it
could.

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

* [Bug rtl-optimization/10050] ifcvt is not smart enough
       [not found] <bug-10050-5562@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-01-15  5:28 ` ian at airs dot com
@ 2006-01-15  6:27 ` ian at airs dot com
  4 siblings, 0 replies; 7+ messages in thread
From: ian at airs dot com @ 2006-01-15  6:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ian at airs dot com  2006-01-15 06:27 -------
Upon further reflection, I don't think this is amenable to a good fix using
conditional moves.  func2 doesn't read from a.  Using conditional moves will
require adding reads from a.  It's not obvious that that is a good tradeoff.

When I look at the code generated for i686 at -O2, the only problem I see is
that for some reason gcc doesn't recognize that a[0] and a[1] can not alias
each other, and it reloads a[0] after writing to a[1].


-- 


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


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

* [Bug rtl-optimization/10050] ifcvt is not smart enough
       [not found] <bug-10050-5562@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-01-15  3:53 ` pinskia at gcc dot gnu dot org
@ 2006-01-15  5:28 ` ian at airs dot com
  2006-01-15  6:27 ` ian at airs dot com
  4 siblings, 0 replies; 7+ messages in thread
From: ian at airs dot com @ 2006-01-15  5:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ian at airs dot com  2006-01-15 05:28 -------
My patch doesn't help for func2, at least on x86, because at the RTL level we
see stores to memory, and my patch doesn't attempt to handle that because of
all the aliasing issues between the then-block and the else-block.

It could be done easily enough with a similar patch, one which checked for a
conditional which only had a then-block or only had an else-block.


-- 

ian at airs dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian at airs dot com


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


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

* [Bug rtl-optimization/10050] ifcvt is not smart enough
       [not found] <bug-10050-5562@http.gcc.gnu.org/bugzilla/>
  2005-12-07  4:14 ` [Bug rtl-optimization/10050] " pinskia at gcc dot gnu dot org
  2006-01-15  3:15 ` pinskia at gcc dot gnu dot org
@ 2006-01-15  3:53 ` pinskia at gcc dot gnu dot org
  2006-01-15  5:28 ` ian at airs dot com
  2006-01-15  6:27 ` ian at airs dot com
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-15  3:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-01-15 03:53 -------
func3 is fixed on x86 but not func2.


-- 


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


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

* [Bug rtl-optimization/10050] ifcvt is not smart enough
       [not found] <bug-10050-5562@http.gcc.gnu.org/bugzilla/>
  2005-12-07  4:14 ` [Bug rtl-optimization/10050] " pinskia at gcc dot gnu dot org
@ 2006-01-15  3:15 ` pinskia at gcc dot gnu dot org
  2006-01-15  3:53 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-15  3:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-01-15 03:15 -------
This might have been fixed by (I am going to check soon) :
2006-01-14  Ian Lance Taylor  <ian@airs.com>

        * ifcvt.c (noce_init_if_info): New static function, broken out of
        noce_process_if_block.
        (noce_process_if_block): Call noce_init_if_info.
        (check_cond_move_block): New static function.
        (cond_move_process_if_block): New static function.
        (process_if_block): Call cond_move_process_if_block.


-- 


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


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

* [Bug rtl-optimization/10050] ifcvt is not smart enough
       [not found] <bug-10050-5562@http.gcc.gnu.org/bugzilla/>
@ 2005-12-07  4:14 ` pinskia at gcc dot gnu dot org
  2006-01-15  3:15 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-07  4:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2005-12-07 04:14 -------
This is only an if conversion failure now.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-09-07 17:41:48         |2005-12-07 04:14:51
               date|                            |
            Summary|Weak optimization on array  |ifcvt is not smart enough
                   |references                  |


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


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

end of thread, other threads:[~2023-05-26  1:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-10050-4@http.gcc.gnu.org/bugzilla/>
2012-02-07 21:05 ` [Bug rtl-optimization/10050] ifcvt is not smart enough pinskia at gcc dot gnu.org
2023-05-26  1:01 ` [Bug middle-end/10050] " pinskia at gcc dot gnu.org
     [not found] <bug-10050-5562@http.gcc.gnu.org/bugzilla/>
2005-12-07  4:14 ` [Bug rtl-optimization/10050] " pinskia at gcc dot gnu dot org
2006-01-15  3:15 ` pinskia at gcc dot gnu dot org
2006-01-15  3:53 ` pinskia at gcc dot gnu dot org
2006-01-15  5:28 ` ian at airs dot com
2006-01-15  6:27 ` ian at airs dot com

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