Skip to content

Commit

Permalink
revert: keep control flow needs Operation
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Dec 11, 2024
1 parent d44340c commit 39ac725
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ControlFlow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ function get_region_removing_missing_values(compiled_fn, insertions)
return_op = MLIR.IR.terminator(block)
for (i, rt) in insertions
if rt isa TracedRNumber
op = Ops.constant(Array{eltype(rt)}(undef, ())).mlir_data
attr = MLIR.IR.DenseElementsAttribute(Array{eltype(rt)}(undef, ()))
op = MLIR.Dialects.stablehlo.constant(; value=attr)
elseif rt isa TracedRArray
op = Ops.constant(Array{eltype(rt)}(undef, size(rt))).mlir_data
attr = MLIR.IR.DenseElementsAttribute(Array{eltype(rt)}(undef, size(rt)))
op = MLIR.Dialects.stablehlo.constant(; value=attr)
else
error("Unknown type $(typeof(rt))")
end
Expand Down

0 comments on commit 39ac725

Please sign in to comment.