View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000509 | mercury | Bug | public | 2020-06-16 02:47 | 2020-06-16 02:47 | ||||||||
Reporter | zs | ||||||||||||
Assigned To | zs | ||||||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | ||||||||
Status | assigned | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000509: higher_order.m optimizes soon-to-be-dead procedures | ||||||||||||
Description | When the compiler has read in a bunch of predicate/function definitions from .opt files, those definitions get added to set of valid preds. higher_order.m looks for optimization opportunities among the set of valid preds. However, the common case is that those .opt files contain a whole bunch of predicates of which the current module uses only a few either directly or indirectly. (When have you written any module that calls all or even most of the predicates exported from e.g. list.m or map.m?) Optimizing the predicates that one of the following compiler passes will soon delete as dead code is a performance bug. We should modify either higher_order.m or its caller to delete dead procedures from the HLDS before it starts its work. Note that we will still need to do a round of dead proc elimination *after* higher_order.m, since higher_order.m can sometimes replace all calls to a predicate with calls to a specialized version, which makes the original version obsolete. However, maybe this could be done by higher_order.m itself *faster* than dead_proc_elim.m could do it, since it should be possible to avoid the need to construct a full call graph to do the job; counting unspecialized call sites should do the job. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|