An alternative would be to mark both functions as NOINLINE, which the
Simplifier will adhere to.
You might also want to have `countA` and `countB` close over a local
variable in order for them not to be floated to the top-level.
If top-level bindings aren't an issue for you, you could simply use
GHC breaks strongly connected components with a so-called loop-breaker. In this
case, maybe countA is the loop-breaker; then countB can inline at all its call
sites, and it'll look very reducible. See "Secrets of the GHC inliner".
If you make countA and countB each call themselves, as well as
I am working through some ghc-exactprint test cases with GHC 9.2.1 and came
across an oddity.
If I parse some source with
{-# LINE 93 "Foo.chs" #-}
on line five, it shows up in the ParseSource as
(L
(Anchor
{ LINE:5:1-25 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"{-#
I'm trying to figure out how to persuade GHC to generate an
irreducible control-flow graph (so I can test an algorithm to convert
it to structured control flow).
The attached image shows (on the left) the classic simple irreducible
CFG: there is a loop between nodes A and B, but neither one
At present, Cmm dataflow analysis works only on Cmm code. I'd like
to do a dataflow analysis on native code. Details at
https://gitlab.haskell.org/ghc/ghc/-/issues/20725
where I'd love an extra set of eyes from the Cmm/Dataflow/Hoopl crowd.
Norman
> I'm struggling to figure out how to get from a CLabel found in a
> CmmProc to a Label used to key the blocks in the control-flow graph
> (CmmGraph) for the CmmProc.
I figured it out---this is the wrong problem. I need to take the
`g_entry` BlockId straight out of the CmmGraph.
Norman
I'm struggling to figure out how to get from a CLabel found in a
CmmProc to a Label used to key the blocks in the control-flow graph
(CmmGraph) for the CmmProc. The code generator needs such a function,
so it must be around somewhere, but I have not yet found it.
I've poked around the