*/
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.
*
/** Load and Store have only Null exceptions. */
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. */
I_FLAG(auto_create_sync , 10, OFF)
/*
* Check, if the value of a node cannot represent a NULL pointer.
*
- * - Casts are skipped
- * - If sel_based_null_check_elim is enabled, all
- * Sel nodes can be skipped.
+ * - Casts are skipped, Sels are skipped
* - A SymConst(entity) is NEVER a NULL pointer
* - Confirms are evaluated
*/
return 1;
assert(mode_is_reference(get_irn_mode(n)));
- if (get_opt_sel_based_null_check_elim()) {
- /* skip all Sel nodes and Cast's */
- while (is_Sel(n)) {
- n = skip_Cast(get_Sel_ptr(n));
- }
+ /* skip all Sel nodes and Cast's */
+ while (is_Sel(n)) {
+ n = skip_Cast(get_Sel_ptr(n));
}
while (1) {
if (is_Cast(n)) { n = get_Cast_op(n); continue; }
class Sel(Op):
"""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 = [
("mem", "memory dependency"),
("ptr", "pointer to object to select from"),