You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since lowered IR is not often consumed by Cassette-like tools for code transformation, I think it could use a bit of clean up. One thing that has bothered me for a bit is code that looks like the following.
stmt = expr = stmts[i]
if isexpr(stmt, :(=))
expr = stmt.args[2]
end
# Do something with expr
expr = Expr(:call, :something_fun, expr.args[2:end]...)
if isexpr(stmt, :(=))
stmt.args[2] = expr
end
I think it would make sense to only allow SSAValues on the RHS of an :(=) Expr in lowered IR, so code that e.g. only wants to rewrite all the calls in a function can simply ignore them.
The text was updated successfully, but these errors were encountered:
This would be nice. I think we probably tried it at one point, and it made the IR significantly larger, which is not surprising. With a more compact encoding it might be ok.
Since lowered IR is not often consumed by Cassette-like tools for code transformation, I think it could use a bit of clean up. One thing that has bothered me for a bit is code that looks like the following.
I think it would make sense to only allow SSAValues on the RHS of an :(=) Expr in lowered IR, so code that e.g. only wants to rewrite all the calls in a function can simply ignore them.
The text was updated successfully, but these errors were encountered: