RE: [commit: ghc] master: Hoopl.Collections: change right folds to strict left folds (2974b2b)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: [commit: ghc] master: Hoopl.Collections: change right folds to strict left folds (2974b2b)

GHC - devs mailing list
Hi Michael

Thanks for pushing forward with Hoopl and other back-end things.

Did this patch elicit any performance gains?  Or what brought it to your attention?

Do you have further plans for Hoopl and GHC's back end?

Simon

|  -----Original Message-----
|  From: ghc-commits [mailto:[hidden email]] On Behalf
|  Of [hidden email]
|  Sent: 03 February 2018 00:56
|  To: [hidden email]
|  Subject: [commit: ghc] master: Hoopl.Collections: change right folds
|  to strict left folds (2974b2b)
|  
|  Repository : ssh://[hidden email]/ghc
|  
|  On branch  : master
|  Link       :
|  https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fghc.ha
|  skell.org%2Ftrac%2Fghc%2Fchangeset%2F2974b2b873b4bad007c619c6e32706123
|  a612428%2Fghc&data=02%7C01%7Csimonpj%40microsoft.com%7C19a7af179b224ee
|  8b74708d56aa0fa00%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C6365321
|  61979971135&sdata=muRQGh3GHuEirDVMUgTb0JKbBUkvqceymKFQTt9eAY0%3D&reser
|  ved=0
|  
|  >---------------------------------------------------------------
|  
|  commit 2974b2b873b4bad007c619c6e32706123a612428
|  Author: Michal Terepeta <[hidden email]>
|  Date:   Thu Feb 1 00:30:22 2018 -0500
|  
|      Hoopl.Collections: change right folds to strict left folds
|  
|      It seems that most uses of these folds should be strict left folds
|      (I could only find a single place that benefits from a right
|  fold).
|      So this removes the existing `setFold`/`mapFold`/`mapFoldWihKey`
|      replaces them with:
|      - `setFoldl`/`mapFoldl`/`mapFoldlWithKey` (strict left folds)
|      - `setFoldr`/`mapFoldr` (for the less common case where a right
|  fold
|        actually makes sense, e.g., `CmmProcPoint`)
|  
|      Signed-off-by: Michal Terepeta <[hidden email]>
|  
|      Test Plan: ./validate
|  
|      Reviewers: bgamari, simonmar
|  
|      Reviewed By: bgamari
|  
|      Subscribers: rwbarton, thomie, carter, kavon
|  
|      Differential Revision: https://phabricator.haskell.org/D4356
|  
|  
|  >---------------------------------------------------------------
|  
|  2974b2b873b4bad007c619c6e32706123a612428
|   compiler/cmm/CmmCommonBlockElim.hs         |  4 ++--
|   compiler/cmm/CmmContFlowOpt.hs             |  6 +++---
|   compiler/cmm/CmmProcPoint.hs               | 20 ++++++++++----------
|   compiler/cmm/CmmUtils.hs                   |  6 +++---
|   compiler/cmm/Hoopl/Collections.hs          | 16 ++++++++++------
|   compiler/cmm/Hoopl/Dataflow.hs             |  8 ++++----
|   compiler/cmm/Hoopl/Graph.hs                |  6 +++---
|   compiler/cmm/Hoopl/Label.hs                |  9 ++++++---
|   compiler/nativeGen/RegAlloc/Graph/Spill.hs |  9 ++++-----
|   9 files changed, 45 insertions(+), 39 deletions(-)
|  
|  Diff suppressed because of size. To see it, use:
|  
|      git diff-tree --root --patch-with-stat --no-color --find-copies-
|  harder --ignore-space-at-eol --cc
|  2974b2b873b4bad007c619c6e32706123a612428
|  _______________________________________________
|  ghc-commits mailing list
|  [hidden email]
|  https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.h
|  askell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-
|  commits&data=02%7C01%7Csimonpj%40microsoft.com%7C19a7af179b224ee8b7470
|  8d56aa0fa00%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C6365321619799
|  71135&sdata=hSeyqtbepopL%2FkSme3DPLOQQKf9WCLWsdVMh86tbx4o%3D&reserved=
|  0
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: [commit: ghc] master: Hoopl.Collections: change right folds to strict left folds (2974b2b)

Michal Terepeta
On Mon, Feb 5, 2018 at 12:19 PM Simon Peyton Jones <[hidden email]> wrote:
Hi Michael

Thanks for pushing forward with Hoopl and other back-end things.

Did this patch elicit any performance gains?  Or what brought it to your attention?

I noticed this some time ago and just now got around to try it out. I was hoping for some improvements, sadly the differences (if any) were too small compared to noise. But it seemed like a nice change on its own, so I decided to send it out.
 
Do you have further plans for Hoopl and GHC's back end?

Other than that, I haven't made any plans yet ;) There are a few tickets that I'd like to make some progress on. And I might try a few experiments looking for some compile-time improvements in the Hoopl/backend - I think currently nobody (including myself) is very keen on introducing new passes or making existing ones more powerful due to compile-time constraints.
And then there are efforts by Moritz (LLVM backend using binary bitcode) and Kavon (LLVM changes to support CPS-style calls) that sound really interesting to me. (but they do require some more time to understand all the context/changes, so I'm not sure if or how much I'll be able to help)

- Michal

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs