
#8275: Loopification breaks profiling ----------------------------------------+---------------------------------- Reporter: jstolarek | Owner: jstolarek Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Profiling | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: 8298 | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by jstolarek): I believe I know the reason for duplicating the stack check. There is at least one bug in !CmmContFlowOpt module. Consider this: {{{ L1: goto L2 L2: whatever L3: goto L1 }}} We are processing blocks from the end. When we reach L3 first guard in `maybe_concat` function (!CmmContFlowOpt.hs, line 123) will turn that blocks into: {{{ L1: goto L2 L2: whatever L3: goto L2 }}} However, the number of predecessors of L2 block is not updated because `backEdges` is computed once before we run `maybe_concat` and is not updated when we make changes to the block structure. Another issue, which I have not yet encountered but I believe may arise as well, comes from the fact that we may map one label to a different one, but again we don't that take into account when determining the number of predecessors. I wrote a fix for that sometime in July, but I did not merged into HEAD - I guess I'll do that now. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8275#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler