From b024e2891d06a81b3fd824f33fc72fb805e03c8f Mon Sep 17 00:00:00 2001 From: Giles Anderson Date: Tue, 9 Apr 2019 21:51:21 +0200 Subject: Document how -O3 is handled by GHC -O2 is the highest value of optimization. -O3 will be reverted to -O2. --- docs/users_guide/using-optimisation.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs/users_guide') diff --git a/docs/users_guide/using-optimisation.rst b/docs/users_guide/using-optimisation.rst index 95adb22a11..990c3960af 100644 --- a/docs/users_guide/using-optimisation.rst +++ b/docs/users_guide/using-optimisation.rst @@ -88,6 +88,17 @@ So, for example, ``ghc -c Foo.hs`` runtime or space *worse* if you're unlucky. They are normally turned on or off individually. +.. ghc-flag:: -On + :shortdesc: Any -On where n > 2 is the same as -O2. + :type: dynamic + :reverse: -O0 + :category: optimization-levels + + .. index:: + single: optimise; aggressively + + Any -On where n > 2 is the same as -O2. + We don't use a ``-O*`` flag for day-to-day work. We use ``-O`` to get respectable speed; e.g., when we want to measure something. When we want to go for broke, we tend to use ``-O2`` (and we go for lots of coffee -- cgit v1.2.1