[GHC] #14282: tagToEnum# . dataToTag# not optimized away

GHC ghc-devs at haskell.org
Mon Oct 2 07:39:56 UTC 2017


#14282: tagToEnum# . dataToTag# not optimized away
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  datacon-tags
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 No, case binders don't get that unfolding... doing so might duplicate
 work.

 Reason it's case-bound is that it's a can-fail primop; see `Note
 [dataToTag#]` in `primops.txt.pp`.  It's the `let/app invariant` in
 action.

 Rats.  I suggest you put a comment with `dataToTagRule` explaining why
 this is tricky and pointing to this ticket, and then leave it.  It's
 tiresome but I don't think it's important enough to merit further
 investment.

 (FWIW ultimately I think the right solution might be to make `dataToTag#`
 CONLIKE, and arrange to give unfoldings to the case binder of a case on a
 CONLIKE application. But I can't forsee all the consequences of that.)

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14282#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list