Two Hoopl questions

Simon Peyton-Jones simonpj at microsoft.com
Fri Aug 2 08:57:07 CEST 2013


|  Does Hoopl handle Bottom internally? By "Bottom" I mean the loop-breaking thing
|  that means "this predecessor does not execute". From the debugging output I

I don't think so.  You supply a lattice

data DataflowLattice a = DataflowLattice  
 { fact_name       :: String          -- Documentation
 , fact_bot        :: a               -- Lattice bottom element
 , fact_join       :: JoinFun a       -- Lattice join plus change flag
                                      -- (changes iff result > old fact)
 }

and the fact_bot value should really be the bottom element.

Simon

|  -----Original Message-----
|  From: Jan Stolarek [mailto:jan.stolarek at p.lodz.pl]
|  Sent: 31 July 2013 17:45
|  To: Edward Z. Yang
|  Cc: Simon Peyton-Jones; ghc-devs
|  Subject: Re: Two Hoopl questions
|  
|  Does Hoopl handle Bottom internally? By "Bottom" I mean the loop-breaking thing
|  that means "this predecessor does not execute". From the debugging output I
|  added to my code it looks that it in fact does because it doesn't do a join when
|  first analyzing a block with two predecessors. If this is really the case then what is
|  the purpose of defining bottom in DataflowLattice?
|  
|  Janek
|  
|  ----- Oryginalna wiadomość -----
|  Od: "Edward Z. Yang" <ezyang at MIT.EDU>
|  Do: "Jan Stolarek" <jan.stolarek at p.lodz.pl>
|  DW: "Simon Peyton-Jones" <simonpj at microsoft.com>, "ghc-devs" <ghc-
|  devs at haskell.org>
|  Wysłane: wtorek, 30 lipiec 2013 20:40:53
|  Temat: Re: Two Hoopl questions
|  
|  What happens when you put a loop in your code?
|  
|  Edward
|  
|  Excerpts from Jan Stolarek's message of Tue Jul 30 08:34:44 -0700 2013:
|  > I'll allow myself to ask my second question again:
|  >
|  > 2) In my algorithm I need to initialize all of the blocks in a graph with bottom
|  element of a lattice, except for the entry block, which needs some other initial
|  values. I've written something like this:
|  >
|  > cmmCopyPropagation dflags graph = do
|  >     let entry_blk = g_entry graph
|  >     g' <- dataflowPassFwd graph [(entry_blk, (Top, Top))] $
|  >             analRewFwd cpLattice cpTransfer cpRewrite
|  >     return . fst $ g'
|  >
|  > cpLattice = DataflowLattice "copy propagation" (Bottom, Bottom) cpJoin
|  >
|  > However, it seems that Bottom values passed to cpLattice are ignored - I could
|  replace second parameter to DataflowLattice with `undefined` and the code would
|  still run without causing an error. Is there something obviously wrong in the way I
|  pass initial fact values to dataflowPassFwd, or should I look for the problem in
|  other parts of my code?
|  >
|  > Janek
|  



More information about the ghc-devs mailing list