This is the mail archive of the
mailing list for the GCC project.
[PATCH]: Fix PR tree-optimization/19038
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: gcc-patches at gcc dot gnu dot org, law at redhat dot com, dnovillo at redhat dot com
- Date: Fri, 21 Jan 2005 14:54:21 -0500
- Subject: [PATCH]: Fix PR tree-optimization/19038
The reason the two names in this testcase can't coalesce (which blocks
us from creating a single loop bb) is because we replace a loop
invariant name with a loop variant one.
Andrew Pinski says:
<pinskia> DannyB: all the loops in thin6d.f looks so much better now,
In general, replacing invariant things with variant ones is a bad idea,
and can only increase register pressure, besides the affect it had on
This patch stops DOM from performing this copy propagation.
An earlier patch had stopped DOM from doing this during expression
replacement, so hopefully this isn't controversial.
Bootstrapped and regtested on i686-pc-linux-gnu.
Okay for mainline?
2005-01-20 Daniel Berlin <dberlin.org>
Fix PR tree-optimization/19038
* tree-ssa-dom.c (cprop_operand): Don't replace loop invariant copies
with loop variant ones.
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.86
diff -u -p -r2.86 tree-ssa-dom.c
--- tree-ssa-dom.c 18 Jan 2005 04:38:59 -0000 2.86
+++ tree-ssa-dom.c 21 Jan 2005 19:29:34 -0000
@@ -2819,6 +2819,10 @@ cprop_operand (tree stmt, use_operand_p
else if (!may_propagate_copy (op, val))
+ /* Don't replace loop invariant variables with loop variant copies. */
+ if (loop_depth_of_name (val) > loop_depth_of_name (op))
+ return false;
/* Dump details. */
if (dump_file && (dump_flags & TDF_DETAILS))