diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-03-09 17:58:52 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-30 23:29:28 +0200 |
| commit | 587340e4f516759bc66786522ffcd9396a1d83f8 (patch) | |
| tree | 9fa8a424561d3febb7a97a5c2163e382674ac4d8 | |
| parent | d4623a914bbee7dc749e51f5702fcbee2599d802 (diff) | |
| download | sparse-dev-587340e4f516759bc66786522ffcd9396a1d83f8.tar.gz | |
kds: add interface for kill_dead_stores()
There are several places where it can be usefull to
remove dead stores but the existing function for this is
local to flow.c & doesn't have an interface easy to use.
Change this make a clean interface for this functionality.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | flow.c | 13 | ||||
| -rw-r--r-- | flow.h | 1 |
2 files changed, 14 insertions, 0 deletions
@@ -766,6 +766,19 @@ void simplify_symbol_usage(struct entrypoint *ep) } END_FOR_EACH_PTR(pseudo); } +void kill_dead_stores(struct entrypoint *ep, pseudo_t addr, int local) +{ + unsigned long generation; + struct basic_block *bb; + + generation = ++bb_generation; + FOR_EACH_PTR(ep->bbs, bb) { + if (bb->children) + continue; + kill_dead_stores_bb(addr, generation, bb, local); + } END_FOR_EACH_PTR(bb); +} + static void mark_bb_reachable(struct basic_block *bb, unsigned long generation) { struct basic_block *child; @@ -14,6 +14,7 @@ struct instruction; extern int simplify_flow(struct entrypoint *ep); +extern void kill_dead_stores(struct entrypoint *ep, pseudo_t addr, int local); extern void simplify_symbol_usage(struct entrypoint *ep); extern void simplify_memops(struct entrypoint *ep); extern void pack_basic_blocks(struct entrypoint *ep); |
