join points and stream fusion?

Simon Peyton Jones simonpj at microsoft.com
Thu Apr 27 22:35:34 UTC 2017


I'm afraid I don't have enough context to understand this thread.

Could you offer a concrete example (as small as possible), and explain how to reproduce the problem you are seeing.  Don't forget to give the compiler version you are using, and any libraries you depend on (as few as poss).

Is this a regression? I.e. did some earlier version of GHC do better on the exact same code?

Maybe open a Trac ticket.

Thanks

Simon

| -----Original Message-----
| From: Glasgow-haskell-users [mailto:glasgow-haskell-users-
| bounces at haskell.org] On Behalf Of Christian Höner zu Siederdissen
| Sent: 27 April 2017 23:10
| To: glasgow-haskell-users at haskell.org
| Subject: Re: join points and stream fusion?
| 
| As an addendum,
| 
| I think what causes this is the following. I have a function
| (|||) xs ys = \lu ij -> xs lu ij Stream.++ ys lu ij xs and ys are two
| stream-generating functions and (Stream.++) concatenates streams. In the
| example I have four streams:
| xs_1 ||| xs_2 ||| xs_3 ||| xs_4
| 
| However, here I end up with a join point on (++). Further evidenced (?)
| by the curious occurance of s1uf4 ... (Left (Left (Left ...))).
| Additional calls then are (Left (Left (Right ))) and so on.
| 
| It would be really good if (|||) is *not* turned into a join point.
| 
| Best,
| Christian
| 
| * Christian Höner zu Siederdissen <choener at bioinf.uni-leipzig.de>
| [27.04.2017 23:30]:
| > Dear all,
| >
| > have some of you experienced bad code generation in ghc-8.2-rc1 in
| > combination with stream fusion from the vector package?
| >
| > Unfortunately, the problem occurs with ADPfusion code which means no
| > simple example, but I'm asking because of the following core below.
| >
| > In ghc-8.0 I have nice core, here however constructor specialization
| > has not happened, neither with the Left/Right nor with the SPEC.
| >
| > The running time in ghc-8.0 is 2.6 seconds, in rc-1 10.9 seconds.
| >
| > Best,
| > Christian
| >
| > joinrec {
| >   $wfoldlM'_loop2_s1uf4
| >   $wfoldlM'_loop2_s1uf4 w_s1ueX ww1_s1uf2 w1_s1ueZ
| >     = case w_s1ueX of { __DEFAULT ->
| >       case w1_s1ueZ of {
| >         Left sa_au90 ->
| >           case sa_au90 of {
| >             Left sa1_XuNq ->
| >               case sa1_XuNq of {
| >                 Left sa2_XuNe ->
| >                   case sa2_XuNe of {
| >                     SL s2_alTo k_alTp ->
| >                       case k_alTp of {
| >                         __DEFAULT ->
| >                           jump $wfoldlM'_loop2_s1uf4
| >                             SPEC ww1_s1uf2 lvl211_s1IDG;
| >                         1# ->
| >                           jump $wfoldlM'_loop2_s1uf4
| >                             SPEC ww1_s1uf2 (Left (Left (Left (SR
| > s2_alTo))))
| >
| > _______________________________________________
| > Glasgow-haskell-users mailing list
| > Glasgow-haskell-users at haskell.org
| > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.h
| > askell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fglasgow-haskell-users&data
| > =02%7C01%7Csimonpj%40microsoft.com%7Cd36333a2218f4c513f5a08d48dba157d%
| > 7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636289277756070800&sdata=
| > DGsBNjZPuDbpEONyJBOy7BDimCELGHNM1trxjCP5luk%3D&reserved=0
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.hask
| ell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fglasgow-haskell-
| users&data=02%7C01%7Csimonpj%40microsoft.com%7Cd36333a2218f4c513f5a08d48d
| ba157d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636289277756070800&sd
| ata=DGsBNjZPuDbpEONyJBOy7BDimCELGHNM1trxjCP5luk%3D&reserved=0


More information about the Glasgow-haskell-users mailing list