Skip to content

Commit

Permalink
Refactor linear_args, linear_results
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Sep 4, 2024
1 parent d44c7da commit 155ddb6
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/Compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,7 @@ function make_mlir_fn(f, args, kwargs, name="main", concretein=true; toscalar=fa
)
end

linear_args = TracedRArray[]
for (k, v) in seen_args
if !(v isa TracedRArray)
continue
end
push!(linear_args, v)
end
linear_args = TracedRArray[v for v in values(seen_args) if v isa TracedRArray]

in_tys = if toscalar
[MLIR.IR.TensorType((), MLIR.IR.Type(eltype(arg))) for arg in linear_args]
Expand Down Expand Up @@ -437,15 +431,7 @@ function make_mlir_fn(f, args, kwargs, name="main", concretein=true; toscalar=fa
)
end

linear_results = TracedRArray[]

for (k, v) in seen_results
if !(v isa TracedRArray)
continue
end

push!(linear_results, v)
end
linear_results = TracedRArray[v for v in values(seen_results) if v isa TracedRArray]

out_tys = [transpose_ty(mlir_type(arg)) for arg in linear_results]

Expand Down

0 comments on commit 155ddb6

Please sign in to comment.