summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonas Haag <jonas@lophus.org>2015-12-18 15:38:40 +0100
committerPhilipp Serrer <philipp@serrer.de>2018-01-18 17:53:14 +0100
commitbf9182f495551d399703bcf50f314278557905b0 (patch)
tree5fdd85b2bc0526fdd036823386d22cb7d0b710cb
parent32e9c21d875034326dad39a914f00c0e3843ef37 (diff)
Various fixes towards X Projs on Calls
-rw-r--r--ir/be/ia32/ia32_bearch.c10
-rw-r--r--ir/ir/irverify.c30
-rw-r--r--ir/lower/lower_calls.c2
3 files changed, 20 insertions, 22 deletions
diff --git a/ir/be/ia32/ia32_bearch.c b/ir/be/ia32/ia32_bearch.c
index 58c219f..73c02b1 100644
--- a/ir/be/ia32/ia32_bearch.c
+++ b/ir/be/ia32/ia32_bearch.c
@@ -1048,9 +1048,13 @@ static void introduce_prologue(ir_graph *const irg, bool omit_fp)
static void introduce_prologue_epilogue(ir_graph *const irg, bool omit_fp)
{
/* introduce epilogue for every return node */
- foreach_irn_in(get_irg_end_block(irg), i, ret) {
- assert(is_ia32_Return(ret));
- introduce_epilogue(ret, omit_fp);
+ foreach_irn_in(get_irg_end_block(irg), i, pred) {
+ if (is_x_except_Proj(pred)) {
+ /* Don't generate any code for X_except ins */
+ } else {
+ assert(is_ia32_Return(pred));
+ introduce_epilogue(pred, omit_fp);
+ }
}
introduce_prologue(irg, omit_fp);
diff --git a/ir/ir/irverify.c b/ir/ir/irverify.c
index 78259a3..0c78df2 100644
--- a/ir/ir/irverify.c
+++ b/ir/ir/irverify.c
@@ -308,7 +308,7 @@ static bool verify_node_Proj_fragile(const ir_node *node)
if (!is_fragile_op(pred))
return true;
- if (!is_x_except_Proj(node) && !is_x_regular_Proj(node))
+ if (!is_x_except_Proj(node))
return true;
if (!ir_throws_exception(pred)) {
const char *kind = is_x_except_Proj(node) ? "exception" : "regular";
@@ -347,7 +347,7 @@ static int verify_node_Block(const ir_node *n)
bool fine = check_mode(n, mode_BB);
for (int i = 0, n_cfgpreds = get_Block_n_cfgpreds(n); i < n_cfgpreds; ++i) {
fine &= check_input_mode(n, i, NULL, mode_X);
- ir_node *pred = get_Block_cfgpred(n, i);
+ ir_node *pred = get_Block_cfgpred(n, i);
ir_node *skipped_pred = skip_Proj(skip_Tuple(pred));
if (!is_cfop(skipped_pred) && !is_Bad(skipped_pred)) {
warn(n, "predecessor %d of block is not a cfop, but %+F", i,
@@ -368,16 +368,16 @@ static int verify_node_Block(const ir_node *n)
fine = false;
} else if (n == get_irg_end_block(irg)
&& !irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_BACKEND)) {
- /* End block may only have Return, Raise or fragile ops as preds. */
- for (int i = 0, n_cfgpreds = get_Block_n_cfgpreds(n); i < n_cfgpreds;
- ++i) {
- ir_node *pred = get_Block_cfgpred(n, i);
+ /* End block may only have Return, Raise, Bad or x_except_Proj as preds. */
+ for (int i = 0, n_cfgpreds = get_Block_n_cfgpreds(n); i < n_cfgpreds; ++i) {
+ ir_node *pred = get_Block_cfgpred(n, i);
ir_node *skipped_pred = skip_Proj(skip_Tuple(pred));
- if (!is_Return(skipped_pred) && !is_Bad(skipped_pred)
- && !is_Raise(skipped_pred)) {
- warn(n, "end block must have Return or Raise predecessor, found %+F",
- skipped_pred);
- fine = false;
+ if (!is_Return(skipped_pred)
+ && !is_Bad(skipped_pred)
+ && !is_Raise(skipped_pred)
+ && !is_x_except_Proj(pred)) {
+ warn(n, "end block must have Return, Raise or fragile op predecessor, found %+F", skipped_pred);
+ fine = false;
}
}
}
@@ -1368,12 +1368,6 @@ void ir_register_verify_node_ops(void)
set_op_verify_proj(op_Tuple, verify_node_Proj_Tuple);
}
-static bool has_multiple_X_succs(const ir_node *node)
-{
- return is_Cond(node) || is_Switch(node)
- || (is_fragile_op(node) && ir_throws_exception(node));
-}
-
static unsigned n_returns;
static bool properties_fine;
@@ -1410,7 +1404,7 @@ static void check_simple_properties(ir_node *node, void *env)
&& irg_has_properties(irg, IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES)) {
foreach_irn_in(node, p, pred) {
ir_node *skipped = skip_Proj(skip_Tuple(pred));
- if (has_multiple_X_succs(skipped)) {
+ if (is_Cond(skipped) || is_Switch(skipped)) {
warn(node, "IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES set, but edge %+F->%+F is critical", node, skipped);
properties_fine = false;
}
diff --git a/ir/lower/lower_calls.c b/ir/lower/lower_calls.c
index 3537b10..a3f3957 100644
--- a/ir/lower/lower_calls.c
+++ b/ir/lower/lower_calls.c
@@ -755,7 +755,7 @@ static void fix_int_return(cl_entry const *const entry,
/* if the Call throws an exception, then we cannot add instruction
* immediately behind it as the call ends the basic block */
- assert(!ir_throws_exception(call));
+ assert(!is_cfop(call));
ir_mode *const mode_ref = get_irn_mode(base_addr);
ir_node *proj_mem = entry->proj_M;