From 8b0cea6a7df0f22699b5975bee8282ffe8c10483 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 11 Sep 2008 23:06:30 +0000 Subject: [PATCH] - fix for r21852: do not remove ALL Conv optimizations, yust those that causing a problem (Conv to mode_b leading to Phib) [r21863] --- ir/ir/iropt.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index a301f03f8..16d006dce 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -5281,9 +5281,16 @@ static ir_node *transform_node_Conv(ir_node *n) { ir_node *c, *oldn = n; ir_node *a = get_Conv_op(n); - if (is_Phi(a)) { - // let deconv do this - return n; + if (get_irn_mode(n) != mode_b && is_const_Phi(a)) { + /* Do NOT optimize mode_b Conv's, this leads to remaining + * Phib nodes later, because the conv_b_lower operation + * is instantly reverted, when it tries to insert a Convb. + */ + c = apply_conv_on_phi(a, get_irn_mode(n)); + if (c) { + DBG_OPT_ALGSIM0(oldn, c, FS_OPT_CONST_PHI); + return c; + } } if (is_Unknown(a)) { /* Conv_A(Unknown_B) -> Unknown_A */ -- 2.20.1