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
function block_transform(ir)
ir = copy(ir)
n_ir = IR()
for (i, bb) in enumerate(ir.blocks)
new_bb = block!(n_ir, i)
for arg in bb.args
argument!(new_bb, arg)
end
for stmt in bb.stmts
push!(new_bb, stmt)
end
if !isempty(bb.branches)
for branch in bb.branches
branch.condition isa Nothing ? branch!(new_bb, branch.block, branch.args...; unless = nothing) : branch!(new_bb, branch.block, branch.args...; unless = branch.condition)
end
end
end
return n_ir
end
but the result is something weird when I use branch!
I'm trying to write a no-op transform:
but the result is something weird when I use branch!
i.e. the block numbers produced in the branch statement by branch! seem to be off and I'm not sure where/if I made a mistake.
Edit: I also know this is inefficient, but can I use
Pipe
here and work with blocks like this?Edit2: I think I see the crux of the issue -
branch.block
is referring to a branch in the original IR, not the new IR.The text was updated successfully, but these errors were encountered: