tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
Estimated hours taken: 16
Branches: main
Replace the workaround for the bootstrapping problem with deep profiling grades
with a proper fix. The fix requires changing the builtin generic unify and
compare routines by removing the pretest comparing the two argument words
for equality. Since this can alter the algorithmic complexity of the program
(for the worse) which a profiler should definitely avoid, we compensate for
this by adding the pretest to the compiler-generated unify and compare
predicates. Since these pretests are executed even when the deleted pretest
wouldn't be, this can also alter algorithmic complexity (for the better)
at the cost of higher constant factors. However, the likelyhood of such
alteration is much smaller: if the top level of a term doesn't match, chances
are most of the function symbols at the lower levels won't match either.
In any case, the user has the option of getting this better algorithmic
complexity anyway by specifying the new option --should-pretest-equality.
However, until we have more experience with it, the documentation of the
new option is commented out.
runtime/mercury_conf_param.h:
Remove the workaround.
runtime/mercury_unify_compare_body.h:
Remove the problematic pretest, and document the problem that would
occur in its presence. Document the user_by_rtti dummy type
constructor. Fix some misleading abort messages.
compiler/options.m:
Add the --should-pretest-equality option.
Add (commented out) documentation for another option for which it was
missing.
doc/user_guide.texi:
Add (commented out) documentation for the new option, and for some
others which it was missing.
compiler/handle_options.m:
Make deep profiling imply the need for pretests in compiler generated
unify and compare predicates.
compiler/unify_proc.m:
If the new option is set, add pretests to unify and compare predicates.
We have to be careful to make sure that we don't add pretests if they
would try to unify two non-ground terms, or if the unification is
guaranteed to fail (since the casts in the pretest would obscure this
fact).
Implementing this required changing the approach of this module.
Instead of most predicates generating single clauses, they now generate
disjuncts for a disjunction that itself can be put inside the
if-then-else whose condition is the pretest. Since these predicates
not longer generate clauses, their names have been changed accordingly.
compiler/hlds_goal.m:
Add a goal feature for marking an if-then-else as representing
a pretest.
compiler/saved_vars.m:
Handle the new goal feature.
compiler/goal_util.m:
Add a function for stripping pretests away.
compiler/post_term_analysis.m:
compiler/term_constr_build.m:
compiler/term_pass1.m:
compiler/term_pass2.m:
Strip pretests away before termination analysis, since the analysis
can't yet prove termination in the presence of the pretest.
compiler/prog_type.m:
Add some auxilary predicates, and change the signature of an existing
predicate to make it more convenient to use.
compiler/type_util.m:
Conform to the change in prog_type.m, and in the process fix code to
avoid the assumption that the names of standard library modules are
unqualified (since the plan is to put them in package "std").
tests/hard_coded/profdeep_seg_fault.{m,exp}:
Fix the test case to be more readable and to generate properly
line-terminated output, now that we pass it.
BUGS:
Remove the entry for the bug fixed by this diff.
Estimated hours taken: 5 recently, lots more in the past.
Branches: main
Workaround the problem that has been causing the deep profiler to seg fault.
Fix some broken documentation.
Fix some test case failure in deep profiling grades.
runtime/mercury_conf_param.h:
Do not define MR_CHECK_DU_EQ if MR_DEEP_PROFILING is enabled.
The short circuit enabled by the former causes execution to miss a
call to the exit port code, which in turn corrupts the data
structures used by the deep profiler.
runtime/mercury_unify_compare_body.h:
Document the problem with MR_CHECK_DU_EQ and deep profiling.
compiler/options.m:
doc/user_guide.texi:
s/--no-warn-known-bad-format-call/--no-warn-bad-format-calls/
s/--warn-unknown-format-call/--warn-unknown-format-calls/
tests/hard_coded/profdeep_seg_fault.m:
Include an explanation of why this test was failing.
tests/general/Mercury.options:
Run string_format_test_{2,3} with `--no-warn-known-bad-format-calls'
since the implementation of that check catches an exception and
this will cause a compiler built in a deep profiling grade to abort.
tests/invalid/Mmakefile:
Don't run the string_format_bad and string_format_unknown tests
in deep profiling grades for the same reason.
test/hard_coded/Mmakefile:
The test case null_char should not be run in deep profiling grades
since it catches exceptions.
Estimated hours taken: 20 (so far)
Branches: main
Add a test case that exposes a bug in the deep profiler (probably
the same bug that prevents us bootstrapping in .profdeep grades) -
there is no fix as yet. The bug causes a segmentation fault in the
one of the deep profiling service calls (this occurs on both x86 and
x86_64 machines.)
tests/hard_coded/Mmakefile:
tests/hard_coded/profdeep_seg_fault.{m,exp}:
Add at test case that exposes a deep profiler bug.