[GHC] #5567: LLVM: Improve alias analysis / performance

GHC ghc-devs at haskell.org
Sun Nov 27 22:14:39 UTC 2016


#5567: LLVM: Improve alias analysis / performance
-------------------------------------+-------------------------------------
        Reporter:  dterei            |                Owner:  dterei
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (LLVM)   |              Version:
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dobenour):

 Have the LLVM devs been asked about this?

 I think that GHC's use of CPS (and its non-use of the C stack) might be
 one of the problems.  LLVM is designed for C-style code and its
 optimizations might not fire on the IR that GHC generates.

 I can think of a solution, but it would involve significant changes, both
 to the compiler and the RTS.  The idea is to do a CPS => SSA transform and
 then lower to LLVM IR from the SSA form.  The Haskell stack would become
 the C stack, with stack switching handled by the assembler code in
 `StgRun`.  LLVM's GC support would be used to generate stack maps to be
 read by the RTS for GC purposes.

 Fortunately, I believe that these tasks are relatively independent.  I
 suspect (from what others have said) that an equivalent of LLVM's
 `mem2reg` for the STG stack is what is needed.

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


More information about the ghc-tickets mailing list