re PR tree-optimization/29789 (Missed invariant out of the loop with conditionals...
authorRichard Guenther <rguenther@suse.de>
Sun, 22 Apr 2007 11:26:49 +0000 (11:26 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 22 Apr 2007 11:26:49 +0000 (11:26 +0000)
commite0a607311cc1cb15070da6cd2c2e10f8eeae867b
tree989716dba1a060e7c03260037932273b5ed3d9a2
parent4c9be806047605b254e608d583c371725d2bc7b4
re PR tree-optimization/29789 (Missed invariant out of the loop with conditionals and shifts)

2007-04-22  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/29789
* tree-ssa-loop-im.c (stmt_cost): Adjust cost of shifts.
(rewrite_reciprocal): New helper split out from
determine_invariantness_stmt.
(rewrite_bittest): Likewise.
(determine_invariantness_stmt): Rewrite (A >> B) & 1 to
A & (1 << B) if (1 << B) is loop invariant but (A >> B)
is not.

* gcc.dg/tree-ssa/ssa-lim-1.c: New testcase.
* gcc.dg/tree-ssa/ssa-lim-2.c: Likewise.

From-SVN: r124042
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-2.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.c