summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonas Haag <jonas@lophus.org>2016-01-23 22:26:56 +0100
committerPhilipp Serrer <philipp@serrer.de>2018-01-18 18:08:17 +0100
commit7db3eb44d75e6a9a00df9102225b4c8ca2ecaeb8 (patch)
tree86c2a6dd30d8d92b1da7b2b47279507e3bb61492
parentfc58fb9b8f4c9e47aa27aa5a6b480104797155c5 (diff)
combo: Do not merge blocks at X_except edges
-rw-r--r--ir/opt/combo.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ir/opt/combo.c b/ir/opt/combo.c
index a809284..7df824b 100644
--- a/ir/opt/combo.c
+++ b/ir/opt/combo.c
@@ -2734,6 +2734,11 @@ static bool only_one_reachable_proj(ir_node *n)
*/
static bool can_exchange(ir_node *pred, ir_node *block)
{
+ if (is_x_except_Proj(pred)) {
+ /* See comment about Raise */
+ return false;
+ }
+ pred = skip_Proj(pred);
if (get_Block_entity(block) != NULL) {
return false;
} else if (is_Jmp(pred)) {
@@ -2775,10 +2780,10 @@ static void apply_cf(ir_node *block, void *ctx)
if (n == 1) {
/* only one predecessor combine */
- ir_node *pred = skip_Proj(get_Block_cfgpred(block, 0));
+ ir_node *pred = get_Block_cfgpred(block, 0);
if (can_exchange(pred, block)) {
- ir_node *new_block = get_nodes_block(pred);
+ ir_node *new_block = get_nodes_block(skip_Proj(pred));
DB((dbg, LEVEL_1, "Fuse %+F with %+F\n", block, new_block));
DBG_OPT_COMBO(block, new_block);
exchange(block, new_block);
@@ -2854,10 +2859,10 @@ static void apply_cf(ir_node *block, void *ctx)
/* fix block */
if (k == 1) {
/* this Block has only one live predecessor */
- ir_node *pred = skip_Proj(in_X[0]);
+ ir_node *pred = in_X[0];
if (can_exchange(pred, block)) {
- ir_node *new_block = get_nodes_block(pred);
+ ir_node *new_block = get_nodes_block(skip_Proj(pred));
DBG_OPT_COMBO(block, new_block);
exchange(block, new_block);
node->node = new_block;