Skip to content

Commit 5845721

Browse files
committed
Revert "compiler: corrections to Conditional lattice"
This reverts commit e1859a1. I was wrong, and lattices are hard.
1 parent 7eb7271 commit 5845721

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

base/compiler/typelattice.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,7 @@ function ⊑(@nospecialize(a), @nospecialize(b))
126126
@assert !isa(b, TypeVar) "invalid lattice item"
127127
if isa(a, Conditional)
128128
if isa(b, Conditional)
129-
issubconditional(a, b) && return true
130-
b = maybe_extract_const_bool(b)
131-
if b isa Bool && maybe_extract_const_bool(a) === b
132-
return true
133-
end
134-
return false
129+
return issubconditional(a, b)
135130
elseif isa(b, Const) && isa(b.val, Bool)
136131
return maybe_extract_const_bool(a) === b.val
137132
end

base/compiler/typelimits.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,6 @@ function tmerge(@nospecialize(typea), @nospecialize(typeb))
299299
isa(typeb, MaybeUndef) ? typeb.typ : typeb))
300300
end
301301
# type-lattice for Conditional wrapper
302-
if isa(typea, Conditional) && isa(typeb, Conditional) && typea.var !== typeb.var
303-
widenconditional(typea) isa Const && (typea = widenconditional(typea))
304-
widenconditional(typeb) isa Const && (typeb = widenconditional(typeb))
305-
end
306302
if isa(typea, Conditional) && isa(typeb, Const)
307303
if typeb.val === true
308304
typeb = Conditional(typea.var, Any, Union{})

0 commit comments

Comments
 (0)