join points and stream fusion?

Christian Höner zu Siederdissen choener at bioinf.uni-leipzig.de
Thu Apr 27 22:09:33 UTC 2017


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
> http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


More information about the Glasgow-haskell-users mailing list