[GHC] #10878: Near doubling of generated code size for compiler/cmm/PprC.hs with commit 5d57087e31

#10878: Near doubling of generated code size for compiler/cmm/PprC.hs with commit 5d57087e31 -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Other Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- As noted in https://ghc.haskell.org/trac/ghc/ticket/7830#comment:28, changes to `compiler/utils/Pretty.hs` in commit 5d57087e31 results in a near doubling of the generated code size of compiler/cmm/PprC.hs` on x86_64/linux. On powerpc/linux this code growth caused this file to fail to build. At @rwbarton's suggestion, I added `NOINLINE` pragmas to `above_` and `beside_` of `compiler/utils/Pretty.hs` and that brought the generated code size down to be just a little more than 30% bigger than it was before commit 5d57087e31. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10878 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10878: Near doubling of generated code size for compiler/cmm/PprC.hs with commit 5d57087e31 -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by erikd): @thomie, if you are happy with the `NOINLINE` solution suggested by @rwbarton, I'm happy to whip up a phab review for this and push it through. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10878#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10878: Near doubling of generated code size for compiler/cmm/PprC.hs with commit 5d57087e31 -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): I'll have a look. I would like to understand the +30% still. Notice I also applied f903949beee3a4e0a925003b5553066c9f513c11, to mitigate another performance problem with the patch you mentioned (5d57087e314bd484dbe14958f9b422be3ac6641a). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10878#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10878: Near doubling of generated code size for compiler/cmm/PprC.hs with commit 5d57087e31 -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by erikd): Also, the `NOLINE` suggestion didn't fix the PowerPC build (stage2 still fails) as noted in https://ghc.haskell.org/trac/ghc/ticket/7830#comment:31 . -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10878#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10878: Near doubling of generated code size for compiler/cmm/PprC.hs with commit 5d57087e31 -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by erikd): Seems #8901 may be related. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10878#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10878: Near doubling of generated code size for compiler/cmm/PprC.hs with commit 5d57087e31 -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): If you need this fixed quickly, you can revert 5d57087e314bd484dbe14958f9b422be3ac6641a and f903949beee3a4e0a925003b5553066c9f513c11. They're not terrible vital. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10878#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10878: Near doubling of generated code size for compiler/cmm/PprC.hs with commit 5d57087e31 -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): -------------------------------------+------------------------------------- Comment (by thomie): I built various trees on Windows 64-bit using BuildFlavour=perf: * current HEAD (78053f449d47a90c977ec3a893524f2cdb5d33f9) with the change to compiler/utils/Pretty.hs reverted (5d57087e314bd484dbe14958f9b422be3ac6641a) * current HEAD + NOINLINE pragmas on above_ and beside_ * current HEAD || measurement || HEAD+revert || HEAD+INLINE || HEAD || || du -bhs compiler/stage2/build/PprCmm.o || 106K || 132K || 203K || || du -bhs compilre/stage2/build/CLabel.o || 838K || 336K || 371K || || du -bhs compiler/stage2/build || 503M || 517M || 533M || So I confirm your findings: PprCmm.o has doubled in size, and adding NOLINE pragmas brings it back to 20-30%. I compared some other .o files, and found to my surprise that CLabel.o has however more than halved in size! But since the total size of the stage2/build directory has increased, we should probably do something. I don't understand yet why adding NOINLINE on above_ and beside_ doesn't bring the sizes back to the baseline. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10878#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC