Commit 1956cbf1 authored by seraphime's avatar seraphime Committed by thomie

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
parent fe8a4e5d
......@@ -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"
......
......@@ -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".
......
......@@ -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
......
......@@ -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
~~~~
......
......@@ -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.
......
......@@ -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
......
Subproject commit dfa9f9158943d2c441add8ccd4309c1b93fb347a
Subproject commit 35fc121fc8cc501ea2713c579a053be7ea65b16e
......@@ -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'],
}
......
# 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'])
test('proffail001', normal, compile_fail, ['-prof -caf-all'])
test('proffail001', normal, compile_fail, ['-prof -fprof-cafs'])
......@@ -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)
......
......@@ -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, [''])
......
......@@ -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, [''])
......
-- 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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment