Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multisymbol issues #53

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mlir/IR/SymbolTable.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
struct SymbolTable
mutable struct SymbolTable
st::API.MlirSymbolTable

function SymbolTable(st)
Expand Down
16 changes: 15 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,23 @@ function make_mlir_fn(f, args, kwargs, name="main", concretein=true; toscalar=fa
return MLIR.Dialects.func.return_(vals)
end

name2 = name

tab = MLIR.IR.SymbolTable(MLIR.IR.Operation(mod))
for i in 0:10000
name2 = if i == 0
name
else
name * string(i)
end
if MLIR.IR.mlirIsNull(MLIR.API.mlirSymbolTableLookup(tab, name2))
break
end
end

func2 = MLIR.IR.block!(MLIR.IR.body(mod)) do
return MLIR.Dialects.func.func_(;
sym_name=name,
sym_name=name2,
function_type=MLIR.IR.FunctionType(in_tys, out_tys),
body=MLIR.IR.Region(),
sym_visibility,
Expand Down
Loading