mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 18:03:36 +00:00
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.
2 lines
22 B
Plaintext
2 lines
22 B
Plaintext
addresses as expected
|