Commit 95cfa646 authored by Matthias Braun's avatar Matthias Braun
Browse files

remove sel_based_null_check flag

We simply always assume that Sel can only return a null pointer if
its input is a null pointer.
parent 0801baa3
...@@ -118,24 +118,6 @@ FIRM_API int get_opt_suppress_downcast_optimization(void); ...@@ -118,24 +118,6 @@ FIRM_API int get_opt_suppress_downcast_optimization(void);
*/ */
FIRM_API void set_opt_ldst_only_null_ptr_exceptions(int value); FIRM_API void set_opt_ldst_only_null_ptr_exceptions(int value);
/**
* Enable/Disable Selection based Null pointer check elimination.
*
* In languages, where all addresses are always Sel nodes, Null
* pointers can only occur as input to Sel nodes.
* If Null pointers are the only source for exceptions in Load and
* Store nodes (as typical in high level languages), we can eliminate
* exception edges from Load and Store when can prove that the Sel
* nodes representing the Load/Store address have non-null inputs.
* Enabling this flag enables this elimination.
*
* Enabling this flag is meaningless if ldst_non_null_exceptions is
* enabled.
*
* This flag should be set for Java style languages.
*/
FIRM_API void set_opt_sel_based_null_check_elim(int value);
/** /**
* Enable/Disable Global Null Pointer Test Elimination. * Enable/Disable Global Null Pointer Test Elimination.
* *
......
...@@ -57,9 +57,6 @@ E_FLAG(suppress_downcast_optimization , 7, OFF) ...@@ -57,9 +57,6 @@ E_FLAG(suppress_downcast_optimization , 7, OFF)
/** Load and Store have only Null exceptions. */ /** Load and Store have only Null exceptions. */
I_FLAG(ldst_only_null_ptr_exceptions , 8, ON) I_FLAG(ldst_only_null_ptr_exceptions , 8, ON)
/** Sel-based Null-pointer check elimination. */
I_FLAG(sel_based_null_check_elim , 9, OFF)
/** Automatically create Sync node during construction. */ /** Automatically create Sync node during construction. */
I_FLAG(auto_create_sync , 10, OFF) I_FLAG(auto_create_sync , 10, OFF)
......
...@@ -167,9 +167,7 @@ FIRM_API int value_not_zero(const ir_node *n, ir_node_cnst_ptr *confirm) ...@@ -167,9 +167,7 @@ FIRM_API int value_not_zero(const ir_node *n, ir_node_cnst_ptr *confirm)
/* /*
* Check, if the value of a node cannot represent a NULL pointer. * Check, if the value of a node cannot represent a NULL pointer.
* *
* - Casts are skipped * - Casts are skipped, Sels are skipped
* - If sel_based_null_check_elim is enabled, all
* Sel nodes can be skipped.
* - A SymConst(entity) is NEVER a NULL pointer * - A SymConst(entity) is NEVER a NULL pointer
* - Confirms are evaluated * - Confirms are evaluated
*/ */
...@@ -185,11 +183,9 @@ FIRM_API int value_not_null(const ir_node *n, ir_node_cnst_ptr *confirm) ...@@ -185,11 +183,9 @@ FIRM_API int value_not_null(const ir_node *n, ir_node_cnst_ptr *confirm)
return 1; return 1;
assert(mode_is_reference(get_irn_mode(n))); assert(mode_is_reference(get_irn_mode(n)));
if (get_opt_sel_based_null_check_elim()) { /* skip all Sel nodes and Cast's */
/* skip all Sel nodes and Cast's */ while (is_Sel(n)) {
while (is_Sel(n)) { n = skip_Cast(get_Sel_ptr(n));
n = skip_Cast(get_Sel_ptr(n));
}
} }
while (1) { while (1) {
if (is_Cast(n)) { n = get_Cast_op(n); continue; } if (is_Cast(n)) { n = get_Cast_op(n); continue; }
......
...@@ -782,7 +782,10 @@ class Rotl(Binop): ...@@ -782,7 +782,10 @@ class Rotl(Binop):
class Sel(Op): class Sel(Op):
"""Computes the address of a entity of a compound type given the base """Computes the address of a entity of a compound type given the base
address of an instance of the compound type.""" address of an instance of the compound type.
Optimisations assume that a Sel node can only produce a NULL pointer if the
ptr input was NULL."""
ins = [ ins = [
("mem", "memory dependency"), ("mem", "memory dependency"),
("ptr", "pointer to object to select from"), ("ptr", "pointer to object to select from"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment