PIPS
Predicates on instructions

Functions

bool native_call_p (call c, string op_name)
 Test if a call is a native instruction of the language. More...
 
bool native_instruction_p (instruction i, string op_name)
 Test if an instruction is a native instruction of the language. More...
 
bool instruction_assign_p (instruction i)
 Test if an instruction is an assignment. More...
 
bool instruction_continue_p (instruction i)
 Test if an instruction is a CONTINUE, that is the FORTRAN nop, the ";" in C or the "pass" in Python... More...
 
bool return_instruction_p (instruction i)
 Test if an instruction is a C or Fortran "return". More...
 
bool fortran_return_instruction_p (instruction i)
 
bool C_return_instruction_p (instruction i)
 
bool exit_instruction_p (instruction i)
 
bool abort_instruction_p (instruction i)
 
bool instruction_stop_p (instruction i)
 Test if an instruction is a Fortran STOP. More...
 
bool instruction_format_p (instruction i)
 Test if an instruction is a Fortran FORMAT. More...
 
bool assignment_block_p (instruction i)
 Checks if an instruction block is a list of assignments, possibly followed by a continue. More...
 

Detailed Description

Function Documentation

◆ abort_instruction_p()

bool abort_instruction_p ( instruction  i)

Definition at line 205 of file instruction.c.

206 {
208 }
bool native_instruction_p(instruction i, string op_name)
Test if an instruction is a native instruction of the language.
Definition: instruction.c:144
#define ABORT_FUNCTION_NAME

References ABORT_FUNCTION_NAME, and native_instruction_p().

Referenced by abort_statement_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignment_block_p()

bool assignment_block_p ( instruction  i)

Checks if an instruction block is a list of assignments, possibly followed by a continue.

FOREACH cannot be used in this case

Definition at line 230 of file instruction.c.

231 {
232  /* FOREACH cannot be used in this case */
233  MAPL(cs,
234  {
235  statement s = STATEMENT(CAR(cs));
236 
237  if(!assignment_statement_p(s))
238  if(!(continue_statement_p(s) && ENDP(CDR(cs)) ))
239  return false;
240  },
241  instruction_block(i));
242  return true;
243 }
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
bool continue_statement_p(statement)
Test if a statement is a CONTINUE, that is the FORTRAN nop, the ";" in C or the "pass" in Python....
Definition: statement.c:203
bool assignment_statement_p(statement)
Test if a statement is an assignment.
Definition: statement.c:135
#define instruction_block(i)
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413

References assignment_statement_p(), CAR, CDR, continue_statement_p(), ENDP, instruction_block, MAPL, and STATEMENT.

Referenced by assignment_block_or_statement_p(), and perfectly_nested_loop_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ C_return_instruction_p()

bool C_return_instruction_p ( instruction  i)

Definition at line 196 of file instruction.c.

197 {
199 }
#define C_RETURN_FUNCTION_NAME

References C_RETURN_FUNCTION_NAME, and native_instruction_p().

Referenced by C_return_statement_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exit_instruction_p()

bool exit_instruction_p ( instruction  i)

Definition at line 201 of file instruction.c.

202 {
204 }
#define EXIT_FUNCTION_NAME

References EXIT_FUNCTION_NAME, and native_instruction_p().

Referenced by exit_statement_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fortran_return_instruction_p()

bool fortran_return_instruction_p ( instruction  i)

Definition at line 191 of file instruction.c.

192 {
194 }
#define RETURN_FUNCTION_NAME

References native_instruction_p(), and RETURN_FUNCTION_NAME.

Referenced by fortran_return_statement_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instruction_assign_p()

bool instruction_assign_p ( instruction  i)

Test if an instruction is an assignment.

Definition at line 164 of file instruction.c.

165 {
167 }
#define ASSIGN_OPERATOR_NAME
Definition: ri-util-local.h:95

References ASSIGN_OPERATOR_NAME, and native_instruction_p().

Referenced by assignment_statement_p(), FindDefinitionsOf_rewrite(), full_copy_p(), hpfc_overlap_kill_unused_scalars_rewrite(), instruction_identification(), sww_seq_rwt(), text_loop(), text_loop_cmf(), and text_loop_craft().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instruction_continue_p()

bool instruction_continue_p ( instruction  i)

Test if an instruction is a CONTINUE, that is the FORTRAN nop, the ";" in C or the "pass" in Python...

according to the language.

Definition at line 173 of file instruction.c.

174 {
176 }
#define CONTINUE_FUNCTION_NAME

References CONTINUE_FUNCTION_NAME, and native_instruction_p().

Referenced by continue_statement_p(), instruction_identification(), and text_instruction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instruction_format_p()

bool instruction_format_p ( instruction  i)

Test if an instruction is a Fortran FORMAT.

Definition at line 222 of file instruction.c.

222  {
224 }
#define FORMAT_FUNCTION_NAME

References FORMAT_FUNCTION_NAME, and native_instruction_p().

Referenced by figure_out_if_it_is_a_format(), format_statement_p(), gather_and_remove_all_format_statements_rewrite(), and instruction_identification().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instruction_stop_p()

bool instruction_stop_p ( instruction  i)

Test if an instruction is a Fortran STOP.

Definition at line 214 of file instruction.c.

214  {
216 }
#define STOP_FUNCTION_NAME

References native_instruction_p(), and STOP_FUNCTION_NAME.

Referenced by instruction_identification(), and stop_statement_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ native_call_p()

bool native_call_p ( call  c,
string  op_name 
)

Test if a call is a native instruction of the language.

Parameters
cis the call to investigate
sis the name of the native instruction to investigate
Returns
true if the instruction is a native instruction of the language
Parameters
op_namep_name

Definition at line 124 of file instruction.c.

125  {
126  bool call_s_p = false;
127 
128  // The called function
129  entity f = call_function(c);
130 
131  if (strcmp(entity_user_name(f), op_name) == 0)
132  call_s_p = true;
133 
134  return call_s_p;
135 }
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
Definition: entity.c:487
#define call_function(x)
Definition: ri.h:709

References call_function, entity_user_name(), and f().

Referenced by native_instruction_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ native_instruction_p()

bool native_instruction_p ( instruction  i,
string  op_name 
)

Test if an instruction is a native instruction of the language.

Parameters
iis the instruction to investigate
sis the name of the native instruction to investigate
Returns
true if the instruction is a native instruction of the language
Parameters
op_namep_name

Definition at line 144 of file instruction.c.

146 {
147  bool call_s_p = false;
148 
149  // Call can be directly inside the instruction,
150  // or wrapped inside an expression
151  if (instruction_call_p(i)) {
152  call_s_p = native_call_p(instruction_call(i), op_name);
153  } else if(instruction_expression_p(i)) {
155  if(syntax_call_p(s)) {
156  call_s_p = native_call_p(syntax_call(s), op_name);
157  }
158  }
159 
160  return call_s_p;
161 }
bool native_call_p(call c, string op_name)
Test if a call is a native instruction of the language.
Definition: instruction.c:124
#define syntax_call_p(x)
Definition: ri.h:2734
#define syntax_call(x)
Definition: ri.h:2736
#define instruction_call_p(x)
Definition: ri.h:1527
#define instruction_expression(x)
Definition: ri.h:1541
#define instruction_call(x)
Definition: ri.h:1529
#define expression_syntax(x)
Definition: ri.h:1247
#define instruction_expression_p(x)
Definition: ri.h:1539

References expression_syntax, instruction_call, instruction_call_p, instruction_expression, instruction_expression_p, native_call_p(), syntax_call, and syntax_call_p.

Referenced by abort_instruction_p(), C_return_instruction_p(), com_statement_p(), exit_instruction_p(), fortran_return_instruction_p(), gen_mpi_send_recv(), instruction_assign_p(), instruction_continue_p(), instruction_format_p(), instruction_stop_p(), return_instruction_p(), and write_statement_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ return_instruction_p()

bool return_instruction_p ( instruction  i)

Test if an instruction is a C or Fortran "return".

Note that this function is not named "instruction_return_p" since it would mean return is a field of instruction ... which used to be the case :)

Definition at line 185 of file instruction.c.

References C_RETURN_FUNCTION_NAME, native_instruction_p(), and RETURN_FUNCTION_NAME.

Referenced by controlize(), instruction_identification(), one_liner_p(), return_statement_p(), and set_pattern().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: