View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000475 | mercury | Feature Request | public | 2019-02-04 01:14 | 2019-02-04 01:14 | ||||||||
Reporter | zs | ||||||||||||
Assigned To | zs | ||||||||||||
Priority | normal | Severity | minor | Reproducibility | N/A | ||||||||
Status | assigned | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000475: flatten maybe output args across calls | ||||||||||||
Description | Many predicates have an output argument which is a maybe(T): they either return no, or they return yes(value). The caller tests whether the result is yes(X). If it is, it picks up X = value, and the heap cell containing the yes wrapper is never referred to again. A compiler optimization should look for predicates where every call is like this, and transform them so that the callee returns TWO results: a boolean which is always meaningful, and a value of type T, which is meaningful only if the bool is yes. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|