aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-30 18:27:47 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:05:18 -0700
commit3f7c3bf7a3ce7641d695b70dd94ebe8e1470652d (patch)
tree02740624dfdaaab58d25fee5f4f457203e9a5c3a /simplify.c
parentSimplify "setcc + select $0<->$1" into "setne/seteq". (diff)
downloadsparse-3f7c3bf7a3ce7641d695b70dd94ebe8e1470652d.tar.gz
sparse-3f7c3bf7a3ce7641d695b70dd94ebe8e1470652d.tar.bz2
sparse-3f7c3bf7a3ce7641d695b70dd94ebe8e1470652d.zip
Don't try to share parenthood fn between phi node removal and
regular CSE. The CSE case is totally different: since both children use the same pseudos, there can be no question that a common parent wouldn't have that pseudo live.
Diffstat (limited to 'simplify.c')
-rw-r--r--simplify.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/simplify.c b/simplify.c
index 1d6f428..3b1ce0e 100644
--- a/simplify.c
+++ b/simplify.c
@@ -25,16 +25,6 @@ static struct basic_block *phi_parent(struct basic_block *source, pseudo_t pseud
return first_basic_block(source->parents);
}
-struct basic_block *trivial_common_parent(struct basic_block *s1, pseudo_t p1,
- struct basic_block *s2, pseudo_t p2)
-{
- s1 = phi_parent(s1, p1);
- s2 = phi_parent(s2, p2);
- if (s1 != s2)
- s1 = NULL;
- return s1;
-}
-
static void clear_phi(struct instruction *insn)
{
pseudo_t phi;
@@ -71,8 +61,8 @@ static int if_convert_phi(struct instruction *insn)
/*
* See if we can find a common source for this..
*/
- source = trivial_common_parent(bb1, p1, bb2, p2);
- if (!source)
+ source = phi_parent(bb1, p1);
+ if (source != phi_parent(bb2, p2))
return 0;
/*