Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Feb 17, 2023
1 parent 9026819 commit 0481a70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,19 @@ end
function replace_coretypes_list!(list::AbstractVector; rev::Bool)
function rep(@nospecialize(x), rev::Bool)
if rev
if isa(x, SSAValue)
return Core.SSAValue(x.id)
elseif isa(x, SlotNumber)
return Core.SlotNumber(x.id)
isa(x, SSAValue) && return Core.SSAValue(x.id)
isa(x, SlotNumber) && return Core.SlotNumber(x.id)
return x
else
isa(x, Core.SSAValue) && return SSAValue(x.id)
isa(x, Core.SlotNumber) && return SlotNumber(x.id)
@static if VERSION v"1.10.0-DEV.631"
isa(x, Core.TypedSlot) && return SlotNumber(x.id)
else
isa(x, Core.Compiler.TypedSlot) && return SlotNumber(x.id)
end
return x
end
if isa(x, Core.SSAValue)
return SSAValue(x.id)
elseif isa(x, Core.SlotNumber) || isa(x, Core.TypedSlot)
return SlotNumber(x.id)
end
return x
end

for (i, stmt) in enumerate(list)
Expand Down
2 changes: 1 addition & 1 deletion test/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ let TT = Union{UInt8, Int8}
end

# issue #92
let x = Core.TypedSlot(1, Any)
let x = Core.SlotNumber(1)
f(x) = objectid(x)
@test isa(@interpret(f(x)), UInt)
end
Expand Down

0 comments on commit 0481a70

Please sign in to comment.