Skip to content
Snippets Groups Projects
Commit 57aedc85 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

CSE-on-creation: Don't create variables aliasing other variables.

parent 32edb1e6
No related branches found
No related tags found
No related merge requests found
......@@ -35,9 +35,11 @@ class CSEToAssignmentMapper(IdentityMapper):
dtype = None
child = self.rec(expr.child)
from pymbolic.primitives import Variable
if isinstance(child, Variable):
return child
var_name = self.add_assignment(expr.prefix, child, dtype)
from pymbolic.primitives import Variable
var = Variable(var_name)
self.expr_to_var[expr.child] = var
return var
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment