PIPS
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "text-util.h"
#include "database.h"
#include "misc.h"
#include "pipsdbm.h"
#include "resources.h"
#include "control.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "properties.h"
#include "sac.h"
#include "ricedg.h"
Go to the source code of this file.
Functions | |
static bool | statement_phi_function_p (statement s) |
checks wether a statement is a phi function call of the form a=phi(cond, vt,vf) where phi is given by a property More... | |
static bool | compact_phi_functions (statement s0, statement s1) |
try to compact two phi-statements into a single one More... | |
static bool | statement_conflicts_p (statement sink, list source_successors) |
checks if there is a write-read conflict between source and sink according to dg successors source_successors More... | |
static void | if_conversion_compact_stats (statement stat, graph dg) |
bool | if_conversion_compact (char *mod_name) |
cproto-generated files More... | |
try to compact two phi-statements into a single one
s0 | first statement to compact |
s1 | second statement to compact |
all datas are handeled as pairs in an array of 2 elements we use i and !i to denote current index and its opposite
let's compare assignment part
ok it may be good, now let's compare both phi functions
first constraint : ref[i] == false_val[i]
second constraint : cond[0] == !cond[1]
yes, we have in s1 a = cond ? b:a; and in s2 a = !cond ? c: a; it will become a = cond ? b :c ;
1:replace false_val[i] by true_val[!i]
2:unlink true_val[!i]
3: replace s[!i] by a continue
Definition at line 89 of file if_conversion_compact.c.
References binary_call_lhs, binary_call_rhs, call_arguments, call_function, CAR, CDR, ENTITY_NOT_P, EXPRESSION, expression_call(), expression_equal_p(), expression_reference(), expression_reference_p(), free_expression(), gen_chunk_undefined, make_continue_instruction(), ok, ref, REFCAR, reference_equal_p(), s1, same_expression_p(), statement_call(), and update_statement_instruction().
Referenced by if_conversion_compact_stats().
bool if_conversion_compact | ( | char * | mod_name | ) |
cproto-generated files
mod_name | od_name |
Definition at line 252 of file if_conversion_compact.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, dg, gen_context_recurse, gen_true2(), if_conversion_compact_stats(), module_name_to_entity(), module_reorder(), reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), reset_proper_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), set_proper_rw_effects(), and statement_domain.
iterate over the trailing statements to find a legal statement to compact we stop when a conflict is found or when we achived our goal
look for a write - read conflict between st and next
Definition at line 184 of file if_conversion_compact.c.
References CAR, CDR, compact_phi_functions(), dg, ENDP, FOREACH, hash_get(), hash_table_free(), ifdebug, pips_debug, POP, print_statement(), STATEMENT, statement_block(), statement_block_p, statement_conflicts_p(), statement_phi_function_p(), statements_to_successors(), and successors().
Referenced by if_conversion_compact().
checks if there is a write-read conflict between source and sink according to dg successors source_successors
if there is a write-read conflict, we cannot do much
Definition at line 161 of file if_conversion_compact.c.
References CONFLICT, conflict_sink, conflict_source, dg_arc_label_conflicts, effect_read_p, effect_write_p, FOREACH, SUCCESSOR, successor_arc_label, successor_vertex, and vertex_to_statement().
Referenced by if_conversion_compact_stats().
checks wether a statement is a phi function call of the form a=phi(cond, vt,vf) where phi is given by a property
s | statement to check |
Definition at line 65 of file if_conversion_compact.c.
References assignment_statement_p(), binary_call_rhs, call_function, entity_intrinsic(), expression_call(), expression_call_p(), get_string_property(), same_entity_p(), and statement_call().
Referenced by if_conversion_compact_stats().