Commit Graph

21 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
Kenneth Graunke b97efa5db5 ir_function_cloning_visitor: Add support for ir_texture. 2010-06-09 11:14:58 -07:00
Kenneth Graunke 26d74cd1d1 Add stub visitor support for ir_texture. 2010-06-09 11:14:57 -07:00
Ian Romanick 2f8b0435b0 Use array delete operator to delete an array
This was detected by valgrind.  I think GCC still does the right
thing, but the C++ spec allows the compiler to do something
stupid... like crash or only delete the first entry in the array.
2010-06-09 11:00:23 -07:00
Ian Romanick e668c2a9ee Reimplement ir_function_inlining_visitor using ir_hierarchical_vistor 2010-05-26 18:58:27 -07:00
Ian Romanick 36ea28646c Refactor ir_dereference data fields to subclasses 2010-05-26 15:23:25 -07:00
Ian Romanick c7b1046a9f Refactor ir_dereference support for ir_visitor
Move the accept method for visitors from ir_dereference to the derived
classes.
2010-05-26 15:23:25 -07:00
Ian Romanick 70fe8b6663 Begin refactoring ir_dereference
Create separate subclasses of ir_dereference for variable, array, and
record dereferences.  As a side effect, array and record dereferences
no longer point to ir_variable objects directly.  Instead they each
point to an ir_dereference_variable object.

This is the first of several steps in the refactoring process.  The
intention is that ir_dereference will eventually become an abstract
base class.
2010-05-26 15:23:19 -07:00
Eric Anholt bdd9b1f3ff Move optimization pass prototypes to a single header. 2010-05-05 11:47:33 -07:00
Kenneth Graunke 05ddebac0a Fix ir_return cloning to actually use the cloned subexpression.
This caused a nasty bug where the function inliner would create new
variables for each of the formal parameters, but the body would still
reference the old copies.

This was highly visible since the dead code eliminator (rightly) removed
the new declarations, leading to printed IR that referenced non-existent
variable names.
2010-05-01 00:31:35 -07:00
Kenneth Graunke c07fdae33f Fix incorrect comments in function inliner. 2010-04-30 23:38:50 -07:00
Eric Anholt 35e8e461ca ir_function_inlining: Handle inlining of structure dereferences. 2010-04-28 18:22:54 -07:00
Eric Anholt c0bfe8723e Correctly handle remapping of array dereferences if ->var is a variable. 2010-04-28 18:22:54 -07:00
Eric Anholt e8e9748722 ir_function_inlining: Implement inlining in many more cases.
We still don't inline for control flow in the inlined function, and we
don't have any limits on what we will inline.
2010-04-23 16:12:44 -07:00
Eric Anholt 22147be898 ir_function_inlining: Avoid NULL dereference on assignment conditions. 2010-04-23 16:12:44 -07:00
Kenneth Graunke 3289886688 Remove ir_label since it is no longer used. 2010-04-21 15:37:10 -07:00
Kenneth Graunke 9fa99f3b6c Refactor IR function representation.
Now, ir_function is emitted as part of the IR instructions, rather than
simply existing in the symbol table.  Individual ir_function_signatures
are not emitted themselves, but only as part of ir_function.
2010-04-21 15:36:36 -07:00
Eric Anholt 0d42321ec1 Add support for inlining calls done inside of expressions. 2010-04-16 12:56:18 -07:00
Eric Anholt 2a7b2b22f4 Repeat the optimization passes until we stop making progress. 2010-04-08 13:43:56 -07:00
Eric Anholt 6192434ac3 Add inlining support for array dereferences. 2010-04-08 13:42:41 -07:00
Eric Anholt cad9766118 Inline functions consisting of a return of an expression. 2010-04-08 11:24:06 -07:00