coneoproject / COFFEE

COFFEE - A COmpiler For Fast Expression Evaluation
Other
9 stars 6 forks source link

ASTKernel.plan_cpu generates unused variables #107

Closed blechta closed 7 years ago

miklos1 commented 7 years ago

I would say it makes some TSFC-generated variables unused and leaves them there.

FabioLuporini commented 7 years ago

These are probably easy to remove.

Reproducible example?

blechta commented 7 years ago
from ufl import *
from tsfc import compile_form
from coffee.plan import ASTKernel

element = FiniteElement("P", interval, 1)
u, v = TrialFunction(element), TestFunction(element)
a = inner(grad(u), grad(v))*dx
c = compile_form(a)
a = ASTKernel(c[0].ast)
a.plan_cpu(dict(optlevel='O2'))
print a.gencode()

Results in unused t3.