Planning
This commit is contained in:
parent
75b7db5a35
commit
ba026b5f59
@ -7,3 +7,4 @@ Approach:
|
|||||||
- Right after expansion to RTL, pattern match set of RTL instructions with same location to graph
|
- Right after expansion to RTL, pattern match set of RTL instructions with same location to graph
|
||||||
- Add notes (persistent over RTL transformations) to any RTL instruction that is relevant
|
- Add notes (persistent over RTL transformations) to any RTL instruction that is relevant
|
||||||
- After all RTL optimizations, add assembly labels before relevant RTL instructions (identified by notes)
|
- After all RTL optimizations, add assembly labels before relevant RTL instructions (identified by notes)
|
||||||
|
- Might need an additional early pass to prevent COMPONENT_REFs to constant/static stuff from being folded early
|
||||||
|
|||||||
@ -44,8 +44,29 @@ static int scan_gimple_statement(const char* funcname, gimple_stmt_iterator* gsi
|
|||||||
}
|
}
|
||||||
|
|
||||||
Build map: location->LocationPattern
|
Build map: location->LocationPattern
|
||||||
|
Build GimpleStatementPattern tree from individual gimple statement
|
||||||
|
Add GimpleStatementPattern to LocationPattern (attached at matching variable names (potentially unnamed ssa))
|
||||||
|
Patterns include markers for member offsets (type, member, value)
|
||||||
|
Later load a set of RTLInstructionPattern to match the patterns
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print_gimple_statement(gsi_stmt(*gsi));
|
print_gimple_statement(gsi_stmt(*gsi));
|
||||||
|
|
||||||
|
gimple* stmt = gsi_stmt(*gsi);
|
||||||
|
enum gimple_code stmt_code = gimple_code(stmt);
|
||||||
|
|
||||||
|
switch (stmt_code) {
|
||||||
|
case GIMPLE_CALL:
|
||||||
|
// check for offsetof, then fall through to operand scanning
|
||||||
|
case GIMPLE_ASSIGN:
|
||||||
|
case GIMPLE_COND:
|
||||||
|
case GIMPLE_LABEL:
|
||||||
|
case GIMPLE_RETURN:
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,9 +93,10 @@ unsigned int access_discover_pass::execute(function* fun) {
|
|||||||
basic_block bb;
|
basic_block bb;
|
||||||
FOR_EACH_BB_FN(bb, fun) {
|
FOR_EACH_BB_FN(bb, fun) {
|
||||||
for (gimple_stmt_iterator gsi = gsi_start_bb(bb); !gsi_end_p(gsi); gsi_next(&gsi)) {
|
for (gimple_stmt_iterator gsi = gsi_start_bb(bb); !gsi_end_p(gsi); gsi_next(&gsi)) {
|
||||||
int stmt_scan_success;
|
if (scan_gimple_statement(funcname, &gsi) != 0) {
|
||||||
if ((stmt_scan_success = scan_gimple_statement(funcname, &gsi)) != 0)
|
internal_error("fatal error in spslr plugin: %s", "failed to scan gimple statement");
|
||||||
return stmt_scan_success;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user