Commit Graph

8 Commits

Author SHA1 Message Date
Eric Anholt
ac95f2f8c8 Include stdio.h and stdlib.h everywhere, and don't cook our own #define NULL. 2010-06-22 12:30:55 -07:00
Ian Romanick
f3a002b503 Refactor ir_dereference support for ir_hierarchical_visitor
Move the accept method for hierarchical visitors from ir_dereference
to the derived classes.  This was mostly straight-forward, but I
suspect that ir_dead_code_local may be broken now.
2010-05-26 15:23:25 -07:00
Ian Romanick
461c294ac5 Use ir_rvalue::variable_referenced instead of open coding it 2010-05-18 13:53:20 +02:00
Ian Romanick
b5a7cf9344 Reimplement ir_dead_code_visitor using ir_hierarchical_vistor
The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
86790dd43f Replace find_dead_code with visit_exec_list
find_dead_code appears to be an open-coded version of visit_exec_list
that was implemented first.
2010-05-17 12:03:13 -07:00
Eric Anholt
438f38c55a ir_dead_code: Fix segfault on handling a return statement with no value. 2010-04-29 13:54:19 -07:00
Kenneth Graunke
6202cbfe36 Fix ir_dead_code for function refactoring. 2010-04-21 16:02:15 -07:00
Eric Anholt
7d21104a8b Remove dead code assignments and variable declarations.
This pass only works on assignments where the variable is never
referenced.  There is no code flow analysis, so it can't do a better
job of avoiding redundant assignments.

For now, the optimizer only does do_dead_code_unlinked(), so it won't
trim the builtin variable list or initializers outside of the scope of
functions.  This is because we don't have the visibility into other
functions that might get linked in in order to eliminate work on
global variables.
2010-04-19 15:33:52 -07:00