[GHC] #16007: Implement `-Os`

#16007: Implement `-Os` -------------------------------------+------------------------------------- Reporter: sgraf | Owner: (none) Type: task | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 8.6.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: #16005 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Popular C compilers like GCC or clang allow to optimise for binary size. Since there are multiple ways in which GHC trades code size for faster programs, it might make sense to follow suit. This ticket is for tracking which optimisations/hacks in the compiler might be affected, as well as Feel free to add items to the following list: - +0.1% increase in code size due to known calls instead of re-using generic apply thunks in #16005 - -0.1% due to `-fstg-lift-lams` #9476 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16007 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16007: Implement `-Os` -------------------------------------+------------------------------------- Reporter: sgraf | Owner: (none) Type: task | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #16005 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AndreasK): Other obvious things: * Specialization * Inlining should trigger less often. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16007#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16007: Implement `-Os` -------------------------------------+------------------------------------- Reporter: sgraf | Owner: (none) Type: task | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #16005 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by sgraf: Old description:
Popular C compilers like GCC or clang allow to optimise for binary size.
Since there are multiple ways in which GHC trades code size for faster programs, it might make sense to follow suit. This ticket is for tracking which optimisations/hacks in the compiler might be affected, as well as
Feel free to add items to the following list:
- +0.1% increase in code size due to known calls instead of re-using generic apply thunks in #16005 - -0.1% due to `-fstg-lift-lams` #9476
New description: Popular C compilers like GCC or clang allow to optimise for binary size. Since there are multiple ways in which GHC trades code size for faster programs, it might make sense to follow suit. This ticket is for tracking which optimisations/hacks in the compiler might be affected, as well as Feel free to add items to the following list: - potentially huge impact due to specialisation, liberate case and inlining - +0.1% increase in code size due to known calls instead of re-using generic apply thunks in #16005 - -0.1% due to `-fstg-lift-lams` #9476 -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16007#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16007: Implement `-Os` -------------------------------------+------------------------------------- Reporter: sgraf | Owner: (none) Type: task | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #16005, #12915, | Differential Rev(s): #14226 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by AndreasK): * related: #16005 => #16005, #12915, #14226 Comment: There were also attempts to run a second common block elimination pass a while ago. That ran into some bugs and in the end went nowhere but would be another good idea for -Os. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16007#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16007: Implement `-Os` -------------------------------------+------------------------------------- Reporter: sgraf | Owner: (none) Type: task | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #16005, #12915, | Differential Rev(s): #14226 | Wiki Page: | -------------------------------------+------------------------------------- Description changed by sgraf: Old description:
Popular C compilers like GCC or clang allow to optimise for binary size.
Since there are multiple ways in which GHC trades code size for faster programs, it might make sense to follow suit. This ticket is for tracking which optimisations/hacks in the compiler might be affected, as well as
Feel free to add items to the following list:
- potentially huge impact due to specialisation, liberate case and inlining - +0.1% increase in code size due to known calls instead of re-using generic apply thunks in #16005 - -0.1% due to `-fstg-lift-lams` #9476
New description: Popular C compilers like GCC or clang allow to optimise for binary size. Since there are multiple ways in which GHC trades code size for faster programs, it might make sense to follow suit. This ticket is for tracking which optimisations/hacks in the compiler might be affected, as well as Feel free to add items to the following list: - potentially huge impact due to specialisation, liberate case and inlining - potential of -0.9% due to a second run of common block elimination (#14226) - +0.1% increase in code size due to known calls instead of re-using generic apply thunks in #16005 - -0.1% due to `-fstg-lift-lams` #9476 -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16007#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16007: Implement `-Os` -------------------------------------+------------------------------------- Reporter: sgraf | Owner: (none) Type: task | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #16005, #12915, | Differential Rev(s): #14226 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * cc: simonmar (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16007#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16007: Implement `-Os` -------------------------------------+------------------------------------- Reporter: sgraf | Owner: (none) Type: task | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #16005, #12915, | Differential Rev(s): #14226 | Wiki Page: | -------------------------------------+------------------------------------- Description changed by sgraf: Old description:
Popular C compilers like GCC or clang allow to optimise for binary size.
Since there are multiple ways in which GHC trades code size for faster programs, it might make sense to follow suit. This ticket is for tracking which optimisations/hacks in the compiler might be affected, as well as
Feel free to add items to the following list:
- potentially huge impact due to specialisation, liberate case and inlining - potential of -0.9% due to a second run of common block elimination (#14226) - +0.1% increase in code size due to known calls instead of re-using generic apply thunks in #16005 - -0.1% due to `-fstg-lift-lams` #9476
New description: Popular C compilers like GCC or clang allow to optimise for binary size. Since there are multiple ways in which GHC trades code size for faster programs, it might make sense to follow suit. This ticket is for tracking which optimisations/hacks in the compiler might be affected. Feel free to add items to the following list: - potentially huge impact due to specialisation, liberate case and inlining - potential of -0.9% due to a second run of common block elimination (#14226) - +0.1% increase in code size due to known calls instead of re-using generic apply thunks in #16005 - -0.1% due to `-fstg-lift-lams` #9476 -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16007#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC