summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeraphime Kirkovski <kirkseraph@gmail.com>2016-05-24 22:30:09 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2016-05-24 23:49:21 +0200
commit1956cbf13bd2138500daebd5f1f0a4931d8710ec (patch)
treee05db790e1db401fd7292d78334aa56738a3e362
parentfe8a4e5d77ef8b2bdb2e7e87d50eb477c94bce43 (diff)
downloadhaskell-1956cbf13bd2138500daebd5f1f0a4931d8710ec.tar.gz
Fix: #12084 deprecate old profiling flags
Change help message so it doesn't specify -auto-all. Make old profiling flags deprecated as they are no longer documented. Update Makefile and documentation accordingly. Update release notes for ghc 8.2 Test Plan: ./verify; `ghc --help` shouldn't specify the -auto-all flag. Furthermore `ghc -fprof -auto-all` should emit a warning Reviewed By: thomie, austin Differential Revision: https://phabricator.haskell.org/D2257 GHC Trac Issues: #12084 Update submodule nofib
-rw-r--r--compiler/main/DynFlags.hs30
-rw-r--r--compiler/profiling/NOTES6
-rw-r--r--docs/storage-mgt/rp.tex6
-rw-r--r--docs/users_guide/8.2.1-notes.rst4
-rw-r--r--docs/users_guide/separate_compilation.rst2
-rw-r--r--driver/ghc-usage.txt2
m---------nofib0
-rw-r--r--testsuite/config/ghc22
-rw-r--r--testsuite/tests/profiling/should_compile/all.T6
-rw-r--r--testsuite/tests/profiling/should_fail/all.T2
-rw-r--r--testsuite/tests/profiling/should_run/Makefile2
-rw-r--r--testsuite/tests/profiling/should_run/all.T2
-rw-r--r--testsuite/tests/stranal/should_compile/all.T2
-rw-r--r--testsuite/tests/stranal/should_compile/newtype.hs2
-rw-r--r--testsuite/tests/th/Makefile4
15 files changed, 52 insertions, 40 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 666748a813..30d4d30a24 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -2915,18 +2915,24 @@ dynamic_flags_deps = [
------ Profiling ----------------------------------------------------
-- OLD profiling flags
- , make_ord_flag defGhcFlag "auto-all" (noArg (\d ->
- d { profAuto = ProfAutoAll } ))
- , make_ord_flag defGhcFlag "no-auto-all" (noArg (\d ->
- d { profAuto = NoProfAuto } ))
- , make_ord_flag defGhcFlag "auto" (noArg (\d ->
- d { profAuto = ProfAutoExports } ))
- , make_ord_flag defGhcFlag "no-auto" (noArg (\d ->
- d { profAuto = NoProfAuto } ))
- , make_ord_flag defGhcFlag "caf-all"
- (NoArg (setGeneralFlag Opt_AutoSccsOnIndividualCafs))
- , make_ord_flag defGhcFlag "no-caf-all"
- (NoArg (unSetGeneralFlag Opt_AutoSccsOnIndividualCafs))
+ , make_dep_flag defGhcFlag "auto-all"
+ (noArg (\d -> d { profAuto = ProfAutoAll } ))
+ "Use -fprof-auto instead"
+ , make_dep_flag defGhcFlag "no-auto-all"
+ (noArg (\d -> d { profAuto = NoProfAuto } ))
+ "Use -fno-prof-auto instead"
+ , make_dep_flag defGhcFlag "auto"
+ (noArg (\d -> d { profAuto = ProfAutoExports } ))
+ "Use -fprof-auto-exported instead"
+ , make_dep_flag defGhcFlag "no-auto"
+ (noArg (\d -> d { profAuto = NoProfAuto } ))
+ "Use -fno-prof-auto instead"
+ , make_dep_flag defGhcFlag "caf-all"
+ (NoArg (setGeneralFlag Opt_AutoSccsOnIndividualCafs))
+ "Use -fprof-cafs instead"
+ , make_dep_flag defGhcFlag "no-caf-all"
+ (NoArg (unSetGeneralFlag Opt_AutoSccsOnIndividualCafs))
+ "Use -fno-prof-cafs instead"
-- NEW profiling flags
, make_ord_flag defGhcFlag "fprof-auto"
diff --git a/compiler/profiling/NOTES b/compiler/profiling/NOTES
index c50cf562e3..824d52b12a 100644
--- a/compiler/profiling/NOTES
+++ b/compiler/profiling/NOTES
@@ -8,12 +8,14 @@ Pre-code-generator-ish
* Automagic insertion of _sccs_ on...
- - If -auto is specified, add _scc_ on each *exported* top-level definition.
+ - If -fprof-auto-exported is specified, add _scc_ on each *exported* top-level definition.
NB this includes CAFs. Done by addAutoCostCentres (Core-to-Core pass).
- - If -auto-all is specified, add _scc_ on *all* top-level definitions.
+ - If -fprof-auto-top is specified, add _scc_ on *all* top-level definitions.
Done by same pass.
+ - If -fprof-auto is specified, add _scc_ on *all* definitions.
+
- Always: just before code generation of module M, onto any CAF
which hasn't already got an explicit cost centre attached, pin
"AllCAFs-M".
diff --git a/docs/storage-mgt/rp.tex b/docs/storage-mgt/rp.tex
index c6de489c59..96b0875120 100644
--- a/docs/storage-mgt/rp.tex
+++ b/docs/storage-mgt/rp.tex
@@ -329,7 +329,7 @@ have to modify their corresponding structures.
runtime system.
First, @nofib/real/symalg@ ends up with a division-by-zero
exception if we add a new field.
-Second, the runtime system option @-auto-all@ clashes in some test files
+Second, the runtime system option @-fprof-auto@ clashes in some test files
in the @nofib@ testing suite (e.g., @spectral/expert@).
\subsection{Initialization code}
@@ -920,13 +920,13 @@ Since cost centre stacks are used as retainer identity, a source program
must be given proper cost centre annotations by programmers.
Alternatively,
we can ask the compiler to automatically insert cost centre annotations.
-For instance, the compiler option @-auto-all@ inserts a cost centre
+For instance, the compiler option @-fprof-auto@ inserts a cost centre
annotation around every top-level function as shown below
(the @-p@ option is a must
because we must build the executable file in a profiling way):
\begin{code}
-$ ghc-inplace -o Foo.out -p -auto-all Foo.hs
+$ ghc-inplace -o Foo.out -p -fprof-auto Foo.hs
\end{code}
The runtime system option @-hR@ tells the executable program to
diff --git a/docs/users_guide/8.2.1-notes.rst b/docs/users_guide/8.2.1-notes.rst
index b52f0ede25..60f17cfbbb 100644
--- a/docs/users_guide/8.2.1-notes.rst
+++ b/docs/users_guide/8.2.1-notes.rst
@@ -27,6 +27,10 @@ Compiler
- TODO FIXME.
+- Old profiling flags -auto-all -auto -caf-all are deprecated
+ and their usage provokes a compile-time warning.
+
+
GHCi
~~~~
diff --git a/docs/users_guide/separate_compilation.rst b/docs/users_guide/separate_compilation.rst
index d5fcd9c813..e83cd8e6aa 100644
--- a/docs/users_guide/separate_compilation.rst
+++ b/docs/users_guide/separate_compilation.rst
@@ -315,7 +315,7 @@ Redirecting the compilation output(s)
.. code-block:: none
- ghc ... -osuf prof.o -hisuf prof.hi -prof -auto-all
+ ghc ... -osuf prof.o -hisuf prof.hi -prof -fprof-auto
to get the profiled version.
diff --git a/driver/ghc-usage.txt b/driver/ghc-usage.txt
index 0b56db7419..1ea8e7d417 100644
--- a/driver/ghc-usage.txt
+++ b/driver/ghc-usage.txt
@@ -50,7 +50,7 @@ Other commonly-used options are:
-O An `optimising' package of compiler flags, for faster code
-prof Compile for cost-centre profiling
- (add -auto-all for automagic cost-centres on all
+ (add -fprof-auto for automagic cost-centres on all
top-level functions)
-H14m Increase compiler's heap size (might make compilation
diff --git a/nofib b/nofib
-Subproject dfa9f9158943d2c441add8ccd4309c1b93fb347
+Subproject 35fc121fc8cc501ea2713c579a053be7ea65b16
diff --git a/testsuite/config/ghc b/testsuite/config/ghc
index 82367d9238..355535153c 100644
--- a/testsuite/config/ghc
+++ b/testsuite/config/ghc
@@ -91,27 +91,27 @@ config.way_flags = lambda name : {
'llvm' : ['-fllvm'],
'optllvm' : ['-O', '-fllvm'],
'debugllvm' : ['-fllvm', '-keep-llvm-files'],
- 'prof' : ['-prof', '-static', '-auto-all', '-fasm'],
- 'profasm' : ['-O', '-prof', '-static', '-auto-all'],
- 'profthreaded' : ['-O', '-prof', '-static', '-auto-all', '-threaded'],
+ 'prof' : ['-prof', '-static', '-fprof-auto', '-fasm'],
+ 'profasm' : ['-O', '-prof', '-static', '-fprof-auto'],
+ 'profthreaded' : ['-O', '-prof', '-static', '-fprof-auto', '-threaded'],
'ghci' : ['--interactive', '-v0', '-ignore-dot-ghci', '+RTS', '-I0.1', '-RTS'],
'threaded1' : ['-threaded', '-debug'],
'threaded1_ls' : ['-threaded', '-debug'],
'threaded2' : ['-O', '-threaded', '-eventlog'],
'threaded2_hT' : ['-O', '-threaded'],
'hpc' : ['-O', '-fhpc', '-hpcdir', '.hpc.' + name ],
- 'prof_hc_hb' : ['-O', '-prof', '-static', '-auto-all'],
- 'prof_hb' : ['-O', '-prof', '-static', '-auto-all'],
- 'prof_hd' : ['-O', '-prof', '-static', '-auto-all'],
- 'prof_hy' : ['-O', '-prof', '-static', '-auto-all'],
- 'prof_hr' : ['-O', '-prof', '-static', '-auto-all'],
+ 'prof_hc_hb' : ['-O', '-prof', '-static', '-fprof-auto'],
+ 'prof_hb' : ['-O', '-prof', '-static', '-fprof-auto'],
+ 'prof_hd' : ['-O', '-prof', '-static', '-fprof-auto'],
+ 'prof_hy' : ['-O', '-prof', '-static', '-fprof-auto'],
+ 'prof_hr' : ['-O', '-prof', '-static', '-fprof-auto'],
'dyn' : ['-O', '-dynamic'],
'static' : ['-O', '-static'],
'debug' : ['-O', '-g', '-dannot-lint'],
# llvm variants...
- 'profllvm' : ['-prof', '-static', '-auto-all', '-fllvm'],
- 'profoptllvm' : ['-O', '-prof', '-static', '-auto-all', '-fllvm'],
- 'profthreadedllvm' : ['-O', '-prof', '-static', '-auto-all', '-threaded', '-fllvm'],
+ 'profllvm' : ['-prof', '-static', '-fprof-auto', '-fllvm'],
+ 'profoptllvm' : ['-O', '-prof', '-static', '-fprof-auto', '-fllvm'],
+ 'profthreadedllvm' : ['-O', '-prof', '-static', '-fprof-auto', '-threaded', '-fllvm'],
'ghci-ext' : ['--interactive', '-v0', '-ignore-dot-ghci', '-fexternal-interpreter', '+RTS', '-I0.1', '-RTS'],
}
diff --git a/testsuite/tests/profiling/should_compile/all.T b/testsuite/tests/profiling/should_compile/all.T
index ca3cc93009..45d0b3aefd 100644
--- a/testsuite/tests/profiling/should_compile/all.T
+++ b/testsuite/tests/profiling/should_compile/all.T
@@ -1,8 +1,8 @@
# We need to run prof001 and prof002 the normal way, as the extra flags
# added for the profiling ways makes it pass
-test('prof001', [only_ways(['normal']), req_profiling], compile_and_run, ['-prof -caf-all'])
-test('prof002', [only_ways(['normal']), req_profiling], compile_and_run, ['-prof -caf-all'])
+test('prof001', [only_ways(['normal']), req_profiling], compile_and_run, ['-prof -fprof-cafs'])
+test('prof002', [only_ways(['normal']), req_profiling], compile_and_run, ['-prof -fprof-cafs'])
-test('T2410', [only_ways(['normal']), req_profiling], compile, ['-O2 -prof -caf-all'])
+test('T2410', [only_ways(['normal']), req_profiling], compile, ['-O2 -prof -fprof-cafs'])
diff --git a/testsuite/tests/profiling/should_fail/all.T b/testsuite/tests/profiling/should_fail/all.T
index d3907515a3..89e04d5344 100644
--- a/testsuite/tests/profiling/should_fail/all.T
+++ b/testsuite/tests/profiling/should_fail/all.T
@@ -1,3 +1,3 @@
-test('proffail001', normal, compile_fail, ['-prof -caf-all'])
+test('proffail001', normal, compile_fail, ['-prof -fprof-cafs'])
diff --git a/testsuite/tests/profiling/should_run/Makefile b/testsuite/tests/profiling/should_run/Makefile
index e46dd973f3..9adb0a1b76 100644
--- a/testsuite/tests/profiling/should_run/Makefile
+++ b/testsuite/tests/profiling/should_run/Makefile
@@ -11,7 +11,7 @@ endef
define scc001Rule
rm -f scc001.hi scc001.o scc001
@echo Compiling with $1
- '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make scc001 -prof -auto-all -rtsopts $1
+ '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make scc001 -prof -fprof-auto -rtsopts $1
./scc001 +RTS -p
$(call scc001Test,f)
$(call scc001Test,g)
diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T
index 1f74a27c8f..a12a0432ac 100644
--- a/testsuite/tests/profiling/should_run/all.T
+++ b/testsuite/tests/profiling/should_run/all.T
@@ -94,7 +94,7 @@ test('callstack001', [expect_broken_for_10037],
test('callstack002', [], compile_and_run,
['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
-# Should not stack overflow with -prof -auto-all
+# Should not stack overflow with -prof -fprof-auto
test('T5363', [], compile_and_run, [''])
test('profinline001', [], compile_and_run, [''])
diff --git a/testsuite/tests/stranal/should_compile/all.T b/testsuite/tests/stranal/should_compile/all.T
index dabc9fcd84..97c3a6fd3f 100644
--- a/testsuite/tests/stranal/should_compile/all.T
+++ b/testsuite/tests/stranal/should_compile/all.T
@@ -27,7 +27,7 @@ test('syn', normal, compile, [''])
test('test', normal, compile, [''])
test('tst', normal, compile, [''])
test('unu', normal, compile, [''])
-test('newtype', req_profiling, compile, ['-prof -auto-all'])
+test('newtype', req_profiling, compile, ['-prof -fprof-auto'])
test('T1988', normal, compile, [''])
test('T8467', normal, compile, [''])
test('T8037', normal, compile, [''])
diff --git a/testsuite/tests/stranal/should_compile/newtype.hs b/testsuite/tests/stranal/should_compile/newtype.hs
index 8d3441fb72..4c9228c0eb 100644
--- a/testsuite/tests/stranal/should_compile/newtype.hs
+++ b/testsuite/tests/stranal/should_compile/newtype.hs
@@ -1,7 +1,7 @@
-- This one killed GHC 6.4 because it bogusly attributed
-- the CPR property to the constructor T
-- Result: a mkWWcpr crash
--- Needs -prof -auto-all to show it up
+-- Needs -prof -fprof-auto to show it up
module ShouldCompile where
diff --git a/testsuite/tests/th/Makefile b/testsuite/tests/th/Makefile
index 5e47e8cda7..2d6cc7036d 100644
--- a/testsuite/tests/th/Makefile
+++ b/testsuite/tests/th/Makefile
@@ -19,14 +19,14 @@ TH_spliceE5_prof::
'$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) $(ghcThWayFlags) --make -no-link -v0 TH_spliceE5_prof.hs
# Using `-osuf .p.o` should work. Note the dot before the `p` (#9760), and
# the dot between the `p` and the `o` (#5554).
- '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -auto-all -osuf .p.o -o $@
+ '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -fprof-auto -osuf .p.o -o $@
./$@
# With -fexternal-interpreter, we don't have to build the non-profiled
# objects first.
TH_spliceE5_prof_ext::
$(RM) TH_spliceE5_prof_ext*.o TH_spliceE5_prof_ext*.hi TH_spliceE5_prof_ext*.p.o
- '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof_ext.hs -prof -auto-all -fexternal-interpreter -o $@
+ '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof_ext.hs -prof -fprof-auto -fexternal-interpreter -o $@
./$@
.PHONY: TH_Depends