From b2c11d8d2a9db53dff6353fedcb96de0792366f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sun, 10 Dec 2017 11:20:25 +0100 Subject: [PATCH] Optimizer - More notes --- c-opopt.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/c-opopt.cc b/c-opopt.cc index 11153cc..d253dac 100644 --- a/c-opopt.cc +++ b/c-opopt.cc @@ -762,6 +762,15 @@ void T_OptData::buildUseDefineChains( * Entering/exiting functions is a bit of a PITA: * - call instructions define function arguments; * - return edges kill locals + * + * OK, so now that we have edge types, things should be easier, as we + * can: + * - handle arguments directly; they're immutable and always + * defined at the function's call site. + * - handle local variables by walking the function's graph, + * ignoring all CALL edges and terminating at the RET edge; + * - handle globals by following all edges and terminating at the + * exit node */ #if 0 // Walk the graph from the entry point until all reachable nodes