Branches: main
library/tree_bitset.m:
Implement `tree_bitset.delete' directly instead of using the more
general `difference' operation.
tests/hard_coded/test_tree_bitset.exp:
tests/hard_coded/test_tree_bitset.m:
Extend test case to cover `delete'.
Estimated hours taken: 12
Branches: main
Fix a performance problem in liveness. Liveness makes many calls to
divide_by_set, but the existing implementation of that predicate in
tree_bitset.m did not exploit the structure of its operands.
After this diff, it now does so, though not yet to the fullest extent
possible. However, even this is enough to reduce the time needed
to compile a variant of the zm_rcpsp_cpx.m stress test from 66 seconds
to 15, with liveness analysis no longer being the bottleneck.
On tools/speedtest, we get about a 0.4% speedup, which is just
above the noise threshold.
library/tree_bitset.m:
Specialize the implementation of divide_by_set for many of
the possible cases. Leave XXXs where further specialization
is possible.
Put some predicate definitions in a more logical order.
compiler/test_bitset.m:
This module has long been used (initially by Simon Taylor, later
by me) to test the correctness of the implementation of first
sparse_bitset.m and later tree_bitset.m. However, since it
slows down all set operations a lot (by doing them twice, once using
a bitset module and once using set_ordlist, and then comparing
the results), it is never enabled in production compilers,
and since it is usually not imported by any ordinary compiler
modules, it is rarely even compiled. It has thus tended to
get bitrot; changes in the set modules it uses need corresponding
changes in this module, but it has not been getting them.
To fix this, move this module from the compiler directory to the
library directory. By including the moved version in the library,
it will always be compiled, and anyone who breaks it will have
to fix the breakage before checking in their change.
The cost is about 16 kilobytes in the Mercury library's .so file,
which is well worth it.
library/test_bitset.m:
The moved module. It had to be updated to compile and work
with the current versions of tree_bitset.m and set_ordlist.m.
library/library.m:
Include the moved module in the library.
doc/Mmakefile:
Since the moved module is only for the implementors of the bitset
modules, do not include it in the documentation.
Sort the names of the modules that are not included in the
documentation.
tests/hard_coded/test_tree_bitset.{m,exp}:
Make this module, which tests the operation of tree_bitset.m,
both more thorough and more controllable.
Make it more thorough by testing it not just with some toy sets
and some small random sets as inputs, but also with some inputs
specifically designed to be stress tests. These are taken from
the old tree_bitset_difference test case.
Make it more thorough in another way by also testing the divide_by_set
operation.
Make it more controllable by making it easy to test just one operation
(for me now, that was of course divide_by_set), without the distraction
of outputs from tests of other operations.
tests/hard_coded/tree_bitset_tester.m:
This module used to do the job of test_bitset.m for test_tree_bitset.m.
This was needed while test_bitset.m was in the compiler directory,
but it is not needed now, and keeping it presents a double maintenance
problem. This diff therefore deletes it, and makes test_tree_bitset.m
use test_bitset.m from the library.
tests/hard_coded/tree_bitset_difference.{m,exp}:
Delete this test case. The stress test inputs it used to test the
difference operation with are now in test_tree_bitset.m, which
uses them to test not just the difference operation, but other
operations as well.
tests/hard_coded/test_bitset.{m,exp}:
Delete this test case, since it seems to be a duplicate of an early
version of tree_bitset_tester.m. Despite its name, it was NOT a copy
of the identically named module that used to be in the compiler
directory.
tests/hard_coded/Mmakefile:
Remove the now unneeded tree_bitset_difference and test_bitset
test cases from the list of test cases.
Branches: main, 11.07
tests/hard_coded/big_array_from_list.m:
tests/hard_coded/hash_table_test.m:
tests/hard_coded/version_hash_table_test2.m:
tests/hard_coded/tree_bitset_tester.m:
Bring these modules up to date with respect to library changes.
tests/hard_coded/Mmakefile:
tests/hard_coded/test_tree_bitset.exp:
tests/hard_coded/test_tree_bitset.m:
Enable test_tree_bitset test case.
Fix condition which prevented BIG_DATA_PROGS being tested.
Estimated hours taken: 32
Branches: main
Add to the library a new module called tree_bitset.m, which is a version
of sparse_bitset.m modified to allow algorithms (for union, intersection etc)
that do not require scanning the entire list of bitmaps.
Use this module as the set representation in quantification.
This reduces the time to compile training_cars_full.m from 250 seconds
to 110 seconds (a reduction of about 56%). As for compiling ordinary files,
the time taken for our usual speedtest (compiling the six largest files
of the compiler itself) is reduced from 20.2 seconds to 19.5 (a reduction
of about 3.5%).
library/tree_bitset.m:
Add the new module.
library/library.m:
Include the new module in the library.
library/int.m:
Improve the formatting of some comments.
library/sparse_bitset.m:
Fix a bug in a comment.
compiler/quantification.m:
Use the new module in the library.
Avoid using predicates that exist in sparse_bitset.m and in set.m
but are available only as functions in tree_bitset.m.
Rename a predicate to avoid ambiguity.
compiler/hlds_out.m:
Output the number of variables in a predicate or procedure when
printing the set of variables and their types.
tests/hard_coded/test_tree_bitset.{m,exp}:
tests/hard_coded/tree_bitset_tester.m:
Two modules of a new test case, modelled on the test case that tests
sparse_bitsets, for testing tree_bitsets.
tests/hard_coded/Mmakefile:
Don't enable the new test case yet, since the .exp file is only a dummy
so far.