summaryrefslogtreecommitdiff
path: root/ir.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-05-04 13:04:40 -0700
committerEric Anholt <eric@anholt.net>2010-05-04 17:00:42 -0700
commit5c89f0ecb9581cbe83442ab3f41f2f3701fffab0 (patch)
treec598e307fcc03ba9eaf5c89c19fe1d1e7b261bc4 /ir.h
parent05a4e59c2410292f595cfe0cc552a86ae69b20d2 (diff)
ir_copy_propagation: New pass to rewrite dereferences to avoid copies.
This is pretty basic. Right now it only handles pure assignments -- same type on each side, no swizzling, and only within basic blocks.
Diffstat (limited to 'ir.h')
-rw-r--r--ir.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/ir.h b/ir.h
index ce92420..d8568a8 100644
--- a/ir.h
+++ b/ir.h
@@ -62,6 +62,7 @@ public:
virtual class ir_return * as_return() { return NULL; }
virtual class ir_if * as_if() { return NULL; }
virtual class ir_swizzle * as_swizzle() { return NULL; }
+ virtual class ir_constant * as_constant() { return NULL; }
/*@}*/
protected:
@@ -787,6 +788,11 @@ public:
ir_constant(int i);
ir_constant(float f);
+ virtual ir_constant *as_constant()
+ {
+ return this;
+ }
+
virtual void accept(ir_visitor *v)
{
v->visit(this);