[m-rev.] for review: dead_pred_elim optimization

Peter Ross pro at missioncriticalit.com
Thu Mar 6 23:11:02 AEDT 2003


On Thu, Mar 06, 2003 at 10:31:13PM +1100, Simon Taylor wrote:
> On 06-Mar-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> > On Thu, Mar 06, 2003 at 08:39:58PM +1100, Simon Taylor wrote:
> > > On 06-Mar-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> > > > On Thu, Mar 06, 2003 at 04:17:37PM +1100, Simon Taylor wrote:
> > > > > On 05-Mar-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> > > > > > Estimated hours taken: 4
> > > > > > Branches: main
> > > > > > 
> > > > > > Fix a performance bug where dead_pred_elim was taking a
> > > > > > significant amount of time to delete entries from the
> > > > > > predicate_table.  With this change dead_pred_elim goes from
> > > > > > 12 minutes to 55 seconds CPU time in the IL grade when
> > > > > > compiling accumulator.m with --intermodule-optimization
> > > > > > turned on.
> > > 
> > > Is that 55 seconds for the entire compilation or just for
> > > dead_pred_elim?
> > > 
> > Just for the dead_pred_elim.
> 
> How long does the entire compilation take?
>  
With the old version around about 25 minutes.

> > > > > > Index: compiler/hlds_module.m
> > > > > > ===================================================================
> > > > > > @@ -1756,22 +1765,45 @@
> > > > > >  
> > > > > >  %-----------------------------------------------------------------------------%
> > > > > >  
> > > > > > +predicate_table_restrict(OrigPredicateTable, PredIds, PredicateTable) :-
> > > > > > +	predicate_table_reset(OrigPredicateTable, PredicateTable0),
> > > > > > +	predicate_table_get_preds(OrigPredicateTable, Preds),
> > > > > > +	PredicateTable = list__foldl(
> > > > > > +			(func(PredId, Table0) = Table :-
> > > > > > +				PredInfo = map__lookup(Preds, PredId),
> > > > > > +				predicate_table_insert_2(Table0,
> > > > > > +						yes(PredId), PredInfo,
> > > > > > +						must_be_qualified,
> > > > > > +						no, _, Table)
> > > > > > +				
> > > > > > +			), PredIds, PredicateTable0).
> > > > > 
> > > > > The `must_be_qualified' here looks wrong.
> > > > > 
> > > > On second thoughts, I think you are right, I have changed it to
> > > > may_be_unqualified.
> > > 
> > > That's wrong too. You need to use the same value that was passed
> > > when the predicate was originally added to the predicate table.
> > 
> > How about this?
> 
> >                                 predicate_table_insert_2(Table0,
> >                                                 yes(PredId), PredInfo,
> >                                                 NeedQual, no, _, Table)
> 
> This is still wrong -- you need to pass the `maybe(partial_qualifier_info)'.
> 
Hmmmmm.   Need to think about how to solve this some more then.  I am
guessing what the best approach would be would be to add a new field to
the predicate_table which caches the values of need_qualifier and
maybe(partial_qualifier_info).  As I can see no easy way to determine
the maybe(partial_qualifier_info).  Do you have any other suggestion?

Pete
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list