When does GHC produce unlifted `let` bindings?

Sebastian Graf sgraf1337 at gmail.com
Sun Oct 29 21:06:49 UTC 2017


Hi folks,

I was debugging a Core-to-Core transform for TEST=spec-inline
<https://github.com/ghc/ghc/blob/fe04f3783b662c52c4a0ff36b2d62a7a575998a5/testsuite/tests/simplCore/should_compile/spec-inline.hs>
and
was wondering (yet again) why GHC produces unlifted `let` bindings in Core
like it seems supposed to be doing
<https://github.com/ghc/ghc/blob/fe04f3783b662c52c4a0ff36b2d62a7a575998a5/testsuite/tests/simplCore/should_compile/spec-inline.stderr#L68-L76>
.

   - Why doesn't this use `case` instead?
   - Is there a semantic difference?
   - Can `case` be used with unlifted types?
   - And if not, why can `let`?

Unlifted `let` seems much close to `case` than to `let`. Some GHC passes
seem to agree.
<https://github.com/ghc/ghc/search?l=Haskell&q=%22strict+let%22&type=&utf8=%E2%9C%93>

Cheers,
Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20171029/bcf22388/attachment.html>


More information about the ghc-devs mailing list