Estimated hours taken: 8
compiler/unify_proc.m:
Generate specialized comparison predicates for types with at most
N functors, for 0 <= N <= 3. This should speed up comparisons
on such types, and reduce code size, since we can dispense with
an if-then else, several calls (e.g. to index and error) and the
index predicate itself.
compiler/options.m:
Add the option that specifies N, the max number of function symbols
for which we will generate specialized comparison predicates.
compiler/handle_options.m:
Clip the value of this option to the maximum supported by unify_proc.m.
compiler/make_hlds.m:
Use the (clipped and therefore accurate) value of this option to decide
which types have specialized comparison predicates and thus can
dispense with an index predicate.
tests/hard_coded/comparison.{m,exp}:
A test case for specialized comparisons.
tests/hard_coded/Mmakefile:
Enable the test case, and sort the list of test cases.