summaryrefslogtreecommitdiff
path: root/ir.h
AgeCommit message (Collapse)Author
2010-06-01ir_vec_index_to_swizzle: Pass to convert indexing of vectors to swizzles.Eric Anholt
This should remove the burden of handling constant vector indexing well from backend codegen, and could help with swizzle optimizations.
2010-05-26ir_dereference::mode is no longer used, kill with fireIan Romanick
2010-05-26Refactor whole-variable assigment checking into member functionIan 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-26Refactor ir_dereference support for ir_hierarchical_visitorIan Romanick
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-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-17Add ir_hierarchical_visitor base class and associated infrastructureIan Romanick
This type of visitor should eventually replace all or almost all current uses of ir_visitor.
2010-05-14Add ir_rvalue::variable_referencedIan Romanick
2010-05-14Implement "sin" and "cos" builtins via new expression operators.Kenneth Graunke
2010-05-14Implement "sign" builtin via a new expression operator.Kenneth Graunke
2010-05-04ir_copy_propagation: New pass to rewrite dereferences to avoid copies.Eric Anholt
This is pretty basic. Right now it only handles pure assignments -- same type on each side, no swizzling, and only within basic blocks.
2010-05-03ir_to_mesa.cpp: Fix missing types on some ir_swizzles.Eric Anholt
Debugging this took forever as I only looked at constructors in ir.cpp to find who wasn't setting up ->type. I dislike hiding code (as opposed to prototypes and definitions) in C++ header files, but in this case I have only myself to blame.
2010-04-28Add ir_dereference constructor for structure field dereferencesIan Romanick
2010-04-28Move array of operator strings out of ir_print_visitor.cpp.Kenneth Graunke
Also implement a reverse-lookup function for use in the IR reader.
2010-04-28Factor out parameter list replacement for later reuse.Kenneth Graunke
2010-04-28Factor out parameter list matching from ast_function::hir for later reuse.Kenneth Graunke
Unfortunately, we still have two kinds of matching - one, with implicit conversions (for use in calls) and another without them (for finding a prototype to overwrite when processing a function body). This commit does not attempt to coalesce the two.
2010-04-28Factor out qualifier checking code for later reuse.Kenneth Graunke
2010-04-28Refactor ir_expression::get_num_operands.Kenneth Graunke
A new static version takes an ir_expression_operation enum, and the original non-static version now uses it. This will make it easier to read operations (where the ir_expression doesn't yet exist).
2010-04-21Fix ir_dead_code for function refactoring.Kenneth Graunke
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-19Remove dead code assignments and variable declarations.Eric Anholt
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-19Mark some variables as having usage beyond the shader's scope.Eric Anholt
This will be important to optimization passes. We don't want to dead-code eliminate writes to out varyings, or propagate uninitialized values of uniforms.
2010-04-14Add an ir_if simplification pass.Eric Anholt
This is relatively simple at the moment, recognizing only constant values, and not (for example) values that are restricted to a range that make the branching constant. However, it does remove 59 lines from the printout of CorrectParse2.vert.
2010-04-08Inline functions consisting of a return of an expression.Eric Anholt
2010-04-07Remove extraneous base-class constructor callsIan Romanick
2010-04-07Put function bodies under function signatures, instead of flat in the parent.Eric Anholt
This will let us know the length of function bodies for the purpose of inlining (among other uses).
2010-04-07Clarify the types of various exec_list in ir.hEric Anholt
2010-04-07Add tracking for extension based warningsIan Romanick
Using '#extension foo: warn' instructs the compiler to generate a warning when some feature of the extension 'foo' is used. This patch adds some infrastructure needed to support that for variables. Similar changes will be needed for types and built-in functions.
2010-04-07Add dynamic cast for ir_loopIan Romanick
2010-04-07Add ir_loop_jump to represent 'break' and 'continue' in loopsIan Romanick
2010-04-07Add ir_loop to represent loopsIan Romanick
This touches a lot of files because everything derived from ir_visitor has to be updated. This is the primary disadvantage of the visitor pattern.
2010-04-06Make constant folding descend into if statements.Eric Anholt
2010-04-06Handle constant expressions using derefs of const values.Eric Anholt
Fixes CorrectParse1.frag and makes for a ton of folding in CorrectParse2.frag.
2010-04-02Track whether whole-arrays are assignableIan Romanick
In GLSL 1.10 this was not allowed, but in GLSL 1.20 and later it is. This causes the following tests to pass: glslparsertest/glsl2/array-09.vert glslparsertest/glsl2/array-13.vert
2010-04-02Add bool/int conversion as IR operations.Eric Anholt
Fixes constructor-09.glsl and CorrectParse2.frag.
2010-04-02Add conversion of bool to float as an IR operation to match int to float.Eric Anholt
2010-04-02Allow array dereferences to be considered as lvalues.Eric Anholt
Fixes glsl-vs-arrays.vert and glsl-vs-mov-after-deref.vert. Regresses parser3.frag which was failing for the wrong reason.
2010-04-02Simplify ir_constant_expression.cpp by factoring operand computation out.Eric Anholt
2010-04-02Remove fake ir_binop_logic_not. I think you meant ir_unop_logic_not.Eric Anholt
2010-04-01Track max accessed array element, reject additional out-of-bounds accessesIan Romanick
For unsized arrays, we can't flag out-of-bounds accesses until the array is redeclared with a size. Track the maximum accessed element and generate an error if the declaration specifies a size that would cause that access to be out-of-bounds. This causes the following tests to pass: glslparsertest/shaders/array10.frag
2010-03-31Add ir_variable::cloneIan Romanick
2010-03-31Add ir_function_signature::function_nameIan Romanick
2010-03-31Make ir_function::signatures privateIan Romanick
2010-03-31Add ir_function::iterator to iterate over function signaturesIan Romanick
2010-03-31Use ir_function::add_signature to create link between function and signatureIan Romanick
ir_function_signature now has a pointer back to the ir_function that owns it.
2010-03-30Initial bits of constant expression evaluatorIan Romanick
Currently only works for constants. The rest will be added later.
2010-03-29Implement ir_if (for if-statments) and conversion from ASTIan Romanick
The following tests now pass: glslparsertest/shaders/if1.frag glslparsertest/shaders/if2.frag The following tests that used to pass now fail. It appears that most of these fail because ast_nequal and ast_equal are not converted to HIR. shaders/glsl-unused-varying.frag shaders/glsl-fs-sqrt-branch.frag
2010-03-29Trivial code cleanup in ir_dereference::is_lvalueIan Romanick