summaryrefslogtreecommitdiff
path: root/ir_function_inlining.cpp
AgeCommit message (Collapse)Author
2010-06-24Merge remote branch 'cworth/master'Eric Anholt
Conflicts: ast_to_hir.cpp ir.cpp This brings in the talloc-based memory management work, so that the compiler (almost) no longer leaks memory.
2010-06-24Make inlined function variables auto, not in/out.Eric Anholt
2010-06-24ir_function_inlining: Re-add the "s/return/retval =/" functionality.Eric Anholt
I ripped it out with the cloning changes yesterday, and should have tested and noticed that there were now returns all over.
2010-06-23exec_node: Add new talloc-based new()Carl Worth
And fix all callers to use the tallbac-based new for exec_node construction. We make ready use of talloc_parent in order to get valid, (and appropriate) talloc owners for everything we construct without having to add new 'ctx' parameters up and down all the call trees. This closes the majority of the memory leaks in the glsl-orangebook-ch06-bump.frag test: total heap usage: 55,623 allocs, 42,672 frees (was 14,533 frees) Now 76.7% leak-free. Woo-hoo!
2010-06-23Add a virtual clone() method to ir_instruction.Eric Anholt
This will be used by function inlining, the linker, and avoiding double usage of the LHS deref chains in ++, *=, and similar operations.
2010-06-22Include stdio.h and stdlib.h everywhere, and don't cook our own #define NULL.Eric Anholt
2010-06-09ir_function_cloning_visitor: Add support for ir_texture.Kenneth Graunke
2010-06-09Add stub visitor support for ir_texture.Kenneth Graunke
2010-06-09Use array delete operator to delete an arrayIan Romanick
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-05-26Reimplement ir_function_inlining_visitor using ir_hierarchical_vistorIan Romanick
2010-05-26Refactor ir_dereference data fields to subclassesIan Romanick
2010-05-26Refactor ir_dereference support for ir_visitorIan Romanick
Move the accept method for visitors from ir_dereference to the derived classes.
2010-05-26Begin refactoring ir_dereferenceIan Romanick
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-05Move optimization pass prototypes to a single header.Eric Anholt
2010-05-01Fix ir_return cloning to actually use the cloned subexpression.Kenneth Graunke
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-04-30Fix incorrect comments in function inliner.Kenneth Graunke
2010-04-28ir_function_inlining: Handle inlining of structure dereferences.Eric Anholt
2010-04-28Correctly handle remapping of array dereferences if ->var is a variable.Eric Anholt
2010-04-23ir_function_inlining: Implement inlining in many more cases.Eric Anholt
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-23ir_function_inlining: Avoid NULL dereference on assignment conditions.Eric Anholt
2010-04-21Remove ir_label since it is no longer used.Kenneth Graunke
2010-04-21Refactor IR function representation.Kenneth Graunke
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-16Add support for inlining calls done inside of expressions.Eric Anholt
2010-04-08Repeat the optimization passes until we stop making progress.Eric Anholt
2010-04-08Add inlining support for array dereferences.Eric Anholt
2010-04-08Inline functions consisting of a return of an expression.Eric Anholt