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
The IR for plus_dummy is expecting three arguments (itself, x and y) but the dynamo actually only takes two (X and Y). If you delete the self argument it works fine:
@dynamofunctionfoo(X, Y)
ir =IR(typeof(plus_dummy), X, Y)
_args = IRTools.arguments(ir)
deletearg!(block(ir, 1), 1)
s =push!(ir, xcall(:+, _args[end-1], _args[end]))
return!(ir, s)
return ir
end
I know I shouldn't build IR from scratch
FWIW, I don't see any reason why we shouldn't support this well. I think I'd ideally write this as
@dynamofunctionfoo(X, Y)
ir =IR()
args =argument!(ir)
x =push!(ir, xcall(:getindex, args, 1))
y =push!(ir, xcall(:getindex, args, 2))
return!(ir, xcall(:+, x, y))
end
The only thing we need is (1) a standardised calling convention for IR without metadata (here I'm assuming that all args are passed in a single args tuple) and (2) some machinery to convert such IR to a codeinfo (which would look a lot like what you've done here, just inside the @dynamo).
I know I shouldn't build IR from scratch, but I really wonder why the following happens:
The text was updated successfully, but these errors were encountered: