[Bug rtl-optimization/22568] Should use cmov in some stituations

2021-05-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=22568

--- Comment #16 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #15)
> The expr.c patch yes.  The tree-ssa-phiopt.c patch, no.  Tree-ssa-phiopt.c
> needs more code rework because of the new infrastructures so I have not
> gotten around to improving the patch yet; been busy with other stuff.

The patch for PR 25290 includes the most of the infrastructure to implement
cmov at the gimple level (See match_simplify_replacement and late_p argument)
but is not enabled because I think it might require a cost model.

[Bug rtl-optimization/22568] Should use cmov in some stituations

2019-06-05 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=22568

--- Comment #15 from Andrew Pinski  ---
(In reply to Eric Gallager from comment #14)
> (In reply to Andrew Pinski from comment #12)
> > I have a patch to tree-ssa-phiopt.c to fix comment #1 though it needs
> > another patch to expr.c to produce the cmov directly from COND_EXPR.  I hope
> > to post both patches for 4.8.0.
> 
> Did you ever post them?

The expr.c patch yes.  The tree-ssa-phiopt.c patch, no.  Tree-ssa-phiopt.c
needs more code rework because of the new infrastructures so I have not gotten
around to improving the patch yet; been busy with other stuff.

[Bug rtl-optimization/22568] Should use cmov in some stituations

2019-06-05 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=22568

--- Comment #14 from Eric Gallager  ---
(In reply to Andrew Pinski from comment #12)
> I have a patch to tree-ssa-phiopt.c to fix comment #1 though it needs
> another patch to expr.c to produce the cmov directly from COND_EXPR.  I hope
> to post both patches for 4.8.0.

Did you ever post them?

[Bug rtl-optimization/22568] Should use cmov in some stituations

2019-03-05 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=22568

Eric Gallager  changed:

   What|Removed |Added

 Blocks|26914   |
 CC||pawel_sikora at zoho dot com

--- Comment #13 from Eric Gallager  ---
*** Bug 26914 has been marked as a duplicate of this bug. ***


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26914
[Bug 26914] lack of conditional moves with floating point

[Bug rtl-optimization/22568] Should use cmov in some stituations

2012-02-08 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22568

--- Comment #12 from Andrew Pinski  2012-02-08 
20:59:51 UTC ---
I have a patch to tree-ssa-phiopt.c to fix comment #1 though it needs another
patch to expr.c to produce the cmov directly from COND_EXPR.  I hope to post
both patches for 4.8.0.


[Bug rtl-optimization/22568] Should use cmov in some stituations

2006-01-15 Thread rguenth at gcc dot gnu dot org


--- Comment #11 from rguenth at gcc dot gnu dot org  2006-01-15 19:11 
---
Created an attachment (id=10647)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10647&action=view)
patch aft the point I stopped working on this


-- 


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



[Bug rtl-optimization/22568] Should use cmov in some stituations

2006-01-14 Thread pinskia at gcc dot gnu dot org


--- Comment #10 from pinskia at gcc dot gnu dot org  2006-01-15 04:05 
---
This was not fixed.

If I rewrite the function like:
ulong f1(ulong a, ulong b)
{
  ulong tmp = ahttp://gcc.gnu.org/bugzilla/show_bug.cgi?id=22568



[Bug rtl-optimization/22568] Should use cmov in some stituations

2006-01-14 Thread pinskia at gcc dot gnu dot org


--- Comment #9 from pinskia at gcc dot gnu dot org  2006-01-15 03:14 ---
This might be fixed by (I am checking right now):
2006-01-14  Ian Lance Taylor  

* 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=22568



[Bug rtl-optimization/22568] Should use cmov in some stituations

2005-09-02 Thread rguenth at gcc dot gnu dot org

--- Additional Comments From rguenth at gcc dot gnu dot org  2005-09-02 
09:54 ---
Blindly applying ifcvt to something like

int a,b;
void foo(int flag)
{
  int x;
  if (flag)
x=a,a=b,b=x;
}

because we're presented with

  if (flag)
  {
int reg_a = a;
x = reg_a;
int reg_b = b;
a = reg_b;
b = x;
  }

and we get cmovs for loading a,b into pseudos instead of
loading them unconditionally.  F.i.

int a,b;
void foobar(int flag)
{
  if (flag)
a = b;
}

will become

foobar:
movl4(%esp), %eax   # flag, flag
testl   %eax, %eax  # flag
cmovne  b, %edx # b,, b
movla, %eax # a, tmp61
cmovne  %edx, %eax  # b,, tmp61
movl%eax, a # tmp61, a
ret

notice how we special-cased the _store_ to use a temporary.  I'll
try applying the same for loads.

-- 


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


[Bug rtl-optimization/22568] Should use cmov in some stituations

2005-09-02 Thread bonzini at gcc dot gnu dot org

--- Additional Comments From bonzini at gcc dot gnu dot org  2005-09-02 
09:47 ---
Richard, can you write a case where it produces awful code?

-- 


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


[Bug rtl-optimization/22568] Should use cmov in some stituations

2005-09-01 Thread rguenth at gcc dot gnu dot org

--- Additional Comments From rguenth at gcc dot gnu dot org  2005-09-01 
12:38 ---
I have a patch that for

int a,b;
void foo(void)
{
  int x;
  if (ahttp://gcc.gnu.org/bugzilla/show_bug.cgi?id=22568


[Bug rtl-optimization/22568] Should use cmov in some stituations

2005-08-31 Thread rguenth at gcc dot gnu dot org

--- Additional Comments From rguenth at gcc dot gnu dot org  2005-08-31 
09:40 ---
With new tree-codes instead of using COND_EXPR we may use the tree-vectorizers
if-conversion and make expand preserve the conditional moves.

Also it shouldn't be too hard to hack rtl if-conversion to handle the case of
exactly two set's in the then/else block, too, and that may turn out to be
profitable always.  Is there any arch whose conditional move will kill
condition codes?  RTL is not my best friend (yet), but ifcvt doens't look too 
bad
either ;)

-- 


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


[Bug rtl-optimization/22568] Should use cmov in some stituations

2005-07-20 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-20 
15:11 ---
IIRC ifcvt is not smart enough to do this.

Confirmed.

-- 
   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Component|c++ |rtl-optimization
 Ever Confirmed||1
   Keywords||missed-optimization
   Last reconfirmed|-00-00 00:00:00 |2005-07-20 15:11:41
   date||


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