Skip to content
Snippets Groups Projects
Commit 88301cda authored by Rafael Ravedutti Lucio Machado's avatar Rafael Ravedutti Lucio Machado
Browse files

Readd transformation to simplify expressions

parent cde356ee
Branches
Tags
No related merge requests found
......@@ -199,6 +199,10 @@ class ArrayAccess:
def transform(self, fn):
self.array = self.array.transform(fn)
self.indexes = [i.transform(fn) for i in self.indexes]
if self.index is not None:
self.index = self.index.transform(fn)
return fn(self)
......
......@@ -227,5 +227,6 @@ class BinOp:
def transform(self, fn):
self.lhs = self.lhs.transform(fn)
self.rhs = self.rhs.transform(fn)
self.bin_op_vector_index_mapping = {i: e.transform(fn) for i, e in self.bin_op_vector_index_mapping.items()}
return fn(self)
......@@ -194,7 +194,7 @@ class ParticleSimulation:
self.global_scope = program
Block.set_block_levels(program)
Transform.apply(program, Transform.flatten)
#Transform.apply(program, Transform.simplify)
Transform.apply(program, Transform.simplify)
#Transform.apply(program, Transform.reuse_index_expressions)
#Transform.apply(program, Transform.reuse_expr_expressions)
#Transform.apply(program, Transform.reuse_array_access_expressions)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment