[GHC] #5925: Add inline version of newArray#
GHC
cvs-ghc at haskell.org
Fri May 10 11:47:59 CEST 2013
#5925: Add inline version of newArray#
---------------------------------+------------------------------------------
Reporter: tibbe | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 7.6.2
Component: Compiler | Version: 7.4.1
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: 4258 | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by simonmar):
I agree with Simon. What I'd do here is look for a `newArray#` applied to
a compile-time constant within a certain range (probably less than 1KB or
so), and compile those directly. There's no need to generate a heap
check, the heap allocation will be automatically aggregated into the
enclosing context and included in the heap check at the enclosing function
or case alternative.
For arrays of unknown size you could make a call to the out-of-line
`allocate()` function to allocate the memory for the array, and then just
inline the code for the `newArray#` primop, heap check and all. It's not
at all clear that this would ever be worth doing though. I'd go for
optimising the known-small-size case only.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5925#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list