mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-15 13:55:07 +00:00
Estimated hours taken: 20 Branches: main A first step in allowing users to ask the compiler to implement the primitive operations needed for dependent parallel conjunctions *either* as calls to library/par_builtin (as at present), *or* as inline C code. The second option should be faster, and should also solve the problem of the compiler not optimizing away unnecessary calls to par_builtin.get. The reason was that in the absence of access to the code of par_builtin.get, simplify.m does not know whether that predicate can loop forever or throw an exception. The corresponding foreign proc can be marked to show that it can do neither. At the moment, the second option doesn't work, but debugging the problem should be simpler once this diff is installed. This is due to the change in the names of the primitive operations to satisfy the readability demands of the paper describing dependent AND-parallelism. This diff passes bootcheck in asm_fast.gc.par with no new test case failures. runtime/mercury_par_builtin.[ch]: New module that contains definitions of the types and operations that implement dependent parallel conjunctions. The content of this module is copied over from library/par_builtin.m, modified slightly for definition as macros. runtime/mercury_types.h: Move the definition of MR_Future here, to define the type name even if the structure is not defined (since it is defined and referred to only in some grades). runtime/mercury_imp.h: #include the new module. runtime/Mmakefile: Add the new module. library/par_builtin.m: Refer to the definitions in runtime/mercury_par_builtin.h. Rename the operations here to make their names meaningful *without* module qualification. compiler/options.m: Add the option --no-inline-par-builtins. Put some help messages in an order consistent with the rest of the module. compiler/builtin_lib_types.m: Move the definition of the future_type here from dep_par_conj.m, since the definitions of other similar types are here. compiler/dep_par_conj.m: Use foreign_procs instead of calls for parallel builtins unless --no-inline-par-builtins is given. compiler/prog_data.m: Add a new foreign_proc attribute, which (for now) can be put on a foreign_proc only by the compiler, not the programmer. It is used by dep_par_conj. compiler/add_pragma.m: compiler/ml_code_gen.m: Handle the new attribute. compiler/mercury_to_mercury.m: Write out the attribute for HLDS dumps, even though it cannot (yet) be read back in. compiler/goal_util.m: Fix some comments. mdbcomp/program_representation.m: Conform to the changes in the names of predicates.
101 lines
2.6 KiB
C
101 lines
2.6 KiB
C
/*
|
|
** Copyright (C) 1993-1998,2000,2003-2009 The University of Melbourne.
|
|
** This file may only be copied under the terms of the GNU Library General
|
|
** Public License - see the file COPYING.LIB in the Mercury distribution.
|
|
*/
|
|
|
|
/*
|
|
** mercury_imp.h - defines the interface to the Mercury abstract machine.
|
|
**
|
|
** IMPORTANT: this must be the *first* header file that is #included.
|
|
** It must come before any system header files. This is because on some
|
|
** systems, the system header files include inline functions, and this
|
|
** causes problems when using global register variables, as gcc requires
|
|
** global register variable declarations to precede any function definitions.
|
|
**
|
|
** This file just #includes most of the other Mercury runtime header files.
|
|
*/
|
|
|
|
#ifndef MERCURY_IMP_H
|
|
#define MERCURY_IMP_H
|
|
|
|
/*
|
|
** The #include of "mercury_conf.h" must come before the `#ifdef MR_USE_DLLS',
|
|
** because mercury_conf.h defines the MR_USE_DLLS macro.
|
|
*/
|
|
|
|
#include "mercury_conf.h"
|
|
|
|
/*
|
|
** The following must come before any declarations of or use of
|
|
** global variables. This is necessary to support DLLs on Windows.
|
|
** Note: `libmer_dll.h' is automatically generated by `Makefile.DLLs'.
|
|
*/
|
|
|
|
#ifdef MR_USE_DLLS
|
|
#include "libmer_dll.h"
|
|
#endif
|
|
|
|
#include "mercury_regs.h" /* must come before system headers */
|
|
|
|
#ifdef MR_HIGHLEVEL_CODE
|
|
#include "mercury.h"
|
|
#endif
|
|
|
|
#include "mercury_std.h"
|
|
#include "mercury_debug.h"
|
|
|
|
#include "mercury_types.h"
|
|
#include "mercury_library_types.h"
|
|
#include "mercury_file.h"
|
|
#include "mercury_string.h"
|
|
#include "mercury_float.h"
|
|
#include "mercury_bootstrap.h"
|
|
#include "mercury_stack_trace.h"
|
|
#include "mercury_accurate_gc.h"
|
|
#include "mercury_stack_layout.h"
|
|
|
|
#include "mercury_tags.h"
|
|
#include "mercury_goto.h"
|
|
#include "mercury_calls.h"
|
|
#include "mercury_ho_call.h"
|
|
#include "mercury_engine.h"
|
|
|
|
#include "mercury_memory.h"
|
|
#include "mercury_heap.h"
|
|
#include "mercury_stacks.h"
|
|
#include "mercury_overflow.h"
|
|
|
|
#include "mercury_label.h"
|
|
#include "mercury_wrapper.h"
|
|
#include "mercury_engine.h"
|
|
#include "mercury_context.h"
|
|
#include "mercury_thread.h"
|
|
#include "mercury_type_info.h"
|
|
#include "mercury_typeclass_info.h"
|
|
#include "mercury_type_tables.h"
|
|
#ifdef MR_USE_TRAIL
|
|
#include "mercury_trail.h"
|
|
#endif
|
|
|
|
#include "mercury_prof.h"
|
|
#include "mercury_misc.h"
|
|
|
|
#include "mercury_region.h"
|
|
#include "mercury_tabling.h"
|
|
#ifdef MR_USE_MINIMAL_MODEL_STACK_COPY
|
|
#include "mercury_minimal_model.h"
|
|
#endif
|
|
#ifdef MR_USE_MINIMAL_MODEL_OWN_STACKS
|
|
#include "mercury_mm_own_stacks.h"
|
|
#endif
|
|
#include "mercury_par_builtin.h"
|
|
|
|
#include "mercury_univ.h"
|
|
#include "mercury_complexity.h"
|
|
#include "mercury_term_size.h"
|
|
|
|
#include "mercury_grade.h"
|
|
|
|
#endif /* not MERCURY_IMP_H */
|