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 Brutus example on nightly. #75

Merged
merged 8 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
7 changes: 5 additions & 2 deletions examples/brutus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ function code_mlir(f, types)
for sidx in bb.stmts
stmt = ir.stmts[sidx]
inst = stmt[:inst]
line = ir.linetable[stmt[:line]+1]
line = @static if VERSION <= v"1.11"
ir.linetable[stmt[:line]+1]
else
last(Base.IRShow.buildLineInfoNode(ir.debuginfo, :var"n/a", sidx))
end

if Meta.isexpr(inst, :call)
val_type = stmt[:type]
Expand Down Expand Up @@ -186,7 +190,6 @@ function code_mlir(f, types)
cond_br = cf.cond_br(cond, true_args, false_args; trueDest=other_dest, falseDest=dest, location)
push!(current_block, cond_br)
elseif inst isa ReturnNode
line = ir.linetable[stmt[:line]+1]
location = Location(string(line.file), line.line, 0)
push!(current_block, func.return_([get_value(inst.val)]; location))
elseif Meta.isexpr(inst, :code_coverage_effect)
Expand Down
4 changes: 2 additions & 2 deletions src/API/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ end

# generate version-less API functions
begin
local ops = mapreduce(∪, [v14, v15, v16]) do mod
local ops = mapreduce(∪, [v14, v15, v16, v17]) do mod
filter(names(mod; all=true)) do name
name ∉ [nameof(mod), :eval, :include] && !startswith(string(name), '#')
end
end

for op in ops
container_mods = filter([v14, v15, v16]) do mod
container_mods = filter([v14, v15, v16, v17]) do mod
op in names(mod; all=true)
end
container_mods = map(container_mods) do mod
Expand Down
6 changes: 3 additions & 3 deletions src/Dialects/Dialects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end

begin
# list dialect operations
local dialectops = mapreduce(mergewith!(∪), [v14, v15, v16]) do mod
local dialectops = mapreduce(mergewith!(∪), [v14, v15, v16, v17]) do mod
dialects = filter(names(mod; all=true)) do dialect
dialect ∉ [nameof(mod), :eval, :include] && !startswith(string(dialect), '#')
end
Expand All @@ -33,11 +33,11 @@ begin
for (dialect, ops) in dialectops
mod = @eval module $dialect
using ...MLIR: MLIR_VERSION, MLIRException
using ..Dialects: v14, v15, v16
using ..Dialects: v14, v15, v16, v17
end

for op in ops
container_mods = filter([v14, v15, v16]) do mod
container_mods = filter([v14, v15, v16, v17]) do mod
dialect in names(mod; all=true) &&
op in names(getproperty(mod, dialect); all=true)
end
Expand Down
Loading