aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-11-18 09:21:27 +0100
committermarha <marha@users.sourceforge.net>2013-11-18 09:21:27 +0100
commit7c20de6c7fb53ed404d4df0d975328318810ce01 (patch)
tree8f837042966482fd961444153eabbc46cb9141eb /mesalib/src/glsl/ir.h
parentaa095d69b3874eb179cb77f033109a7f8f351041 (diff)
downloadvcxsrv-7c20de6c7fb53ed404d4df0d975328318810ce01.tar.gz
vcxsrv-7c20de6c7fb53ed404d4df0d975328318810ce01.tar.bz2
vcxsrv-7c20de6c7fb53ed404d4df0d975328318810ce01.zip
libXext mesa xkeyboard-config pixman 18 nov 2013
xkeyboard-config commit 51ab5c95e48b2a040fc132bb5c1a5e8bbe86c8f4 libXext commit bb24f2970f2e425f4df90c9b73d078ad15a73fbb pixman commit f473fd1e7553a4e92a0d72bea360f05d005c9a88 mesa commit 2cfbf84dadc915b7075a3f1cbb569daf699d5ff0
Diffstat (limited to 'mesalib/src/glsl/ir.h')
-rw-r--r--mesalib/src/glsl/ir.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h
index 2f06fb9ea..7859702ed 100644
--- a/mesalib/src/glsl/ir.h
+++ b/mesalib/src/glsl/ir.h
@@ -139,6 +139,16 @@ public:
virtual class ir_jump * as_jump() { return NULL; }
/*@}*/
+ /**
+ * IR equality method: Return true if the referenced instruction would
+ * return the same value as this one.
+ *
+ * This intended to be used for CSE and algebraic optimizations, on rvalues
+ * in particular. No support for other instruction types (assignments,
+ * jumps, calls, etc.) is planned.
+ */
+ virtual bool equals(ir_instruction *ir);
+
protected:
ir_instruction()
{
@@ -1405,6 +1415,8 @@ public:
return this;
}
+ virtual bool equals(ir_instruction *ir);
+
virtual ir_expression *clone(void *mem_ctx, struct hash_table *ht) const;
/**
@@ -1739,6 +1751,8 @@ public:
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+ virtual bool equals(ir_instruction *ir);
+
/**
* Return a string representing the ir_texture_opcode.
*/
@@ -1843,6 +1857,8 @@ public:
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+ virtual bool equals(ir_instruction *ir);
+
bool is_lvalue() const
{
return val->is_lvalue() && !mask.has_duplicates;
@@ -1907,6 +1923,8 @@ public:
return this;
}
+ virtual bool equals(ir_instruction *ir);
+
/**
* Get the variable that is ultimately referenced by an r-value
*/
@@ -1965,6 +1983,8 @@ public:
return this;
}
+ virtual bool equals(ir_instruction *ir);
+
/**
* Get the variable that is ultimately referenced by an r-value
*/
@@ -2099,6 +2119,8 @@ public:
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+ virtual bool equals(ir_instruction *ir);
+
/**
* Get a particular component of a constant as a specific type
*