[Bug rtl-optimization/26190] combine misses some distributivity

2023-10-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26190

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
  Known to work||10.1.0
 Resolution|--- |FIXED
   Target Milestone|--- |10.0

--- Comment #9 from Andrew Pinski  ---
Fixed in GCC 10.1.0.

Part of it was fixed with r6-3841-g84ff66b884e9 . The other part which fixed
this was improving EVRP.

[Bug rtl-optimization/26190] combine misses some distributivity

2019-12-22 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26190

--- Comment #8 from Eric Gallager  ---
Does the new combine2 pass proposed for GCC 10 fix any of this?

[Bug rtl-optimization/26190] combine misses some distributivity

2018-10-01 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26190

--- Comment #7 from Jim Wilson  ---
I didn't realize it was assigned to me.  I changed it to unassigned.

[Bug rtl-optimization/26190] combine misses some distributivity

2018-10-01 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26190

--- Comment #6 from Eric Gallager  ---
(In reply to Jim Wilson from comment #5)
> I haven't done any further work on this.

The reason I was asking was because this bug shows up in my search of bugs with
an assignee but that aren't marked as ASSIGNED. So, should I change the status
to ASSIGNED here, or leave it as NEW and remove you as the assignee?

[Bug rtl-optimization/26190] combine misses some distributivity

2018-10-01 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26190

--- Comment #5 from Jim Wilson  ---
I haven't done any further work on this.

[Bug rtl-optimization/26190] combine misses some distributivity

2018-10-01 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26190

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #4 from Eric Gallager  ---
(In reply to Jim Wilson from comment #3)
> This ior/shift/xor optimization be done during combine with a simplify-rtx.c
> patch.  I wrote a prototype and tested it.  Combine canonicalizes
> shift/logical as logical/shift, so we actually have to look for
> ior/xor/shift.  I see that the optimization does not happen on arm and
> aarch64 because the 0x4002 value does not fit into the immediate range for
> logical ops, gets loaded into a register, pulled out of the loop, and hence
> is not available to combine.  We would have to perform the optimization
> earlier for it to work for arm/aarch64.  I tried MIPS, and see that because
> MIPS promotes HImode to SImode we don't have enough info to prove that the
> opt is safe.  We need type info to make this work.  This prototype does work
> for the x86 target which has both 16-bit immediates and HImode instructions.
> 
> Next I wrote a prototype for match-and-simplify.  This one works for all 4
> targets.  We have to handle ior/shift/xor as match-and-simplify does not
> canonicalize logical/shift.  I noticed that if I change the xor to an ior,
> then it gets optimized in combine because of the canonicalization for mips
> and x86, but not for arm/aarch64 again because the constant was pulled out
> of the loop.  So it seems that match-and-simplify should canonicalize
> shift/logical to logical/shift too.  That would also reduce the number of
> patterns we need to match when performing this ior/shift/xor optimization.
> 
> These are prototype patches that need a bit more work to handle more cases,
> and to prove that they test all conditions necessary to make them safe. 
> This is my first attempt to use the wi:: functions, so there might be a
> better way to do this.

Have you made further attempts since?

[Bug rtl-optimization/26190] combine misses some distributivity

2015-04-24 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26190

Jim Wilson wilson at gcc dot gnu.org changed:

   What|Removed |Added

 CC||wilson at gcc dot gnu.org

--- Comment #2 from Jim Wilson wilson at gcc dot gnu.org ---
Created attachment 35398
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=35398action=edit
prototype patches for ior/shift/xor optimization


[Bug rtl-optimization/26190] combine misses some distributivity

2015-04-24 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26190

--- Comment #3 from Jim Wilson wilson at gcc dot gnu.org ---
This ior/shift/xor optimization be done during combine with a simplify-rtx.c
patch.  I wrote a prototype and tested it.  Combine canonicalizes shift/logical
as logical/shift, so we actually have to look for ior/xor/shift.  I see that
the optimization does not happen on arm and aarch64 because the 0x4002 value
does not fit into the immediate range for logical ops, gets loaded into a
register, pulled out of the loop, and hence is not available to combine.  We
would have to perform the optimization earlier for it to work for arm/aarch64. 
I tried MIPS, and see that because MIPS promotes HImode to SImode we don't have
enough info to prove that the opt is safe.  We need type info to make this
work.  This prototype does work for the x86 target which has both 16-bit
immediates and HImode instructions.

Next I wrote a prototype for match-and-simplify.  This one works for all 4
targets.  We have to handle ior/shift/xor as match-and-simplify does not
canonicalize logical/shift.  I noticed that if I change the xor to an ior, then
it gets optimized in combine because of the canonicalization for mips and x86,
but not for arm/aarch64 again because the constant was pulled out of the loop. 
So it seems that match-and-simplify should canonicalize shift/logical to
logical/shift too.  That would also reduce the number of patterns we need to
match when performing this ior/shift/xor optimization.

These are prototype patches that need a bit more work to handle more cases, and
to prove that they test all conditions necessary to make them safe.  This is my
first attempt to use the wi:: functions, so there might be a better way to do
this.


[Bug rtl-optimization/26190] combine misses some distributivity

2006-02-25 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-25 19:40 ---
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2006-02-25 19:40:32
   date||


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



[Bug rtl-optimization/26190] combine misses some distributivity

2006-02-09 Thread bonzini at gnu dot org


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

  BugsThisDependsOn||16798, 18395
   Severity|normal  |enhancement
   Priority|P3  |P1


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



[Bug rtl-optimization/26190] combine misses some distributivity

2006-02-09 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||missed-optimization
   Priority|P1  |P5


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