Commit e2b72cad authored by thoughtpolice's avatar thoughtpolice

Mark retry# as returning bottom.

This change helps the simplifier eliminate unreachable code, since
retry# technically doesn't return.

This closes ticket #8091.
Authored-by: parcs's avatarPatrick Palka <patrick@parcs.ath.cx>
Signed-off-by: thoughtpolice's avatarAustin Seipp <aseipp@pobox.com>
parent 94be5889
......@@ -1611,9 +1611,24 @@ primop AtomicallyOp "atomically#" GenPrimOp
out_of_line = True
has_side_effects = True
-- NB: retry#'s strictness information specifies it to return bottom.
-- This lets the compiler perform some extra simplifications, since retry#
-- will technically never return.
--
-- This allows the simplifier to replace things like:
--
-- case retry# s1
-- (# s2, a #) -> e
--
-- with:
--
-- retry# s1
--
-- where 'e' would be unreachable anyway.
primop RetryOp "retry#" GenPrimOp
State# RealWorld -> (# State# RealWorld, a #)
with
strictness = { \ _arity -> mkStrictSig (mkTopDmdType [topDmd] botRes) }
out_of_line = True
has_side_effects = True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment