Commit Graph

3 Commits

Author SHA1 Message Date
Zoltan Somogyi
2f7c5fb87f Update the programming style of some tests. 2020-10-03 17:43:38 +10:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
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.
2015-02-14 20:14:03 +11:00
Peter Wang
dd75f74cff Try to retain structure sharing information when we come across a generic
Branches: main

Try to retain structure sharing information when we come across a generic
call.  If the arguments to the call are all inputs then we can deduce that no
new sharing is introduced.  If the call has output arguments but all of them
are of types that we can't reuse (e.g. atomic types) then for our purposes no
sharing is introduced.

compiler/structure_reuse.direct.detect_garbage.m:
compiler/structure_reuse.indirect.m:
compiler/structure_sharing.analysis.m:
	At generic calls, check the types and modes of the arguments to see if
	we can avoid `top' sharing.

compiler/structure_sharing.domain.m:
	Add predicate to check if we can predict bottom sharing from a call's
	argument types and modes.

compiler/ctgc.util.m:
	Rename `type_is_reusable' to `top_cell_may_be_reusable' to be clear
	about what it means.

	Export `type_needs_sharing_analysis'.  Make it fail for dummy types.

compiler/structure_reuse.direct.choose_reuse.m:
	Conform to predicate renaming.

compiler/mercury_compile.m:
	Call loop invariant hoisting when making `.analysis' and `.trans_opt'
	files if structure reuse is enabled.  This prevents different
	structure reuse results between the .analysis/.trans_opt and .c files.
	The differing results could lead one module to call a reuse procedure
	inside another module, which isn't actually defined in the .c file.

tests/hard_coded/Mercury.options:
tests/hard_coded/Mmakefile:
tests/hard_coded/reuse_ho.exp:
tests/hard_coded/reuse_ho.m:
	Add a test case.
2008-06-16 04:52:32 +00:00