[m-rev.] for review: respect no_inline for opt-exporting

Peter Wang novalazy at gmail.com
Wed Jul 21 14:02:54 AEST 2010


Branches: main

compiler/intermod.m:
        Don't opt-export predicates which have been marked `no_inline',
        regardless of any other conditions. e.g. try_io_det/5 was exported
        because it has higher-order arguments, but it is marked `no_inline'.

diff --git a/compiler/intermod.m b/compiler/intermod.m
index 8b127f2..4abf7e2 100644
--- a/compiler/intermod.m
+++ b/compiler/intermod.m
@@ -335,6 +335,9 @@ should_be_processed(ProcessLocalPreds, PredId, PredInfo, TypeSpecForcePreds,
         % These will be recreated in the importing module.
         \+ set.member(PredId, TypeSpecForcePreds),
 
+        % Don't export non-inlinable predicates.
+        \+ check_marker(Markers, marker_user_marked_no_inline),
+
         % No point exporting code which isn't very inlinable.
         module_info_get_globals(ModuleInfo, Globals),
         globals.get_target(Globals, Target),
@@ -344,9 +347,7 @@ should_be_processed(ProcessLocalPreds, PredId, PredInfo, TypeSpecForcePreds,
         proc_info_get_eval_method(ProcInfo, eval_normal),
 
         (
-            inlining.is_simple_clause_list(Clauses, InlineThreshold + Arity),
-            pred_info_get_markers(PredInfo, Markers),
-            \+ check_marker(Markers, marker_user_marked_no_inline)
+            inlining.is_simple_clause_list(Clauses, InlineThreshold + Arity)
         ;
             pred_info_requested_inlining(PredInfo)
         ;

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list