Mercury Bugs - mercury
View Issue Details
0000475mercuryFeature Requestpublic2019-02-04 01:142019-02-04 01:14
Reporterzs 
Assigned Tozs 
PrioritynormalSeverityminorReproducibilityN/A
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000475: flatten maybe output args across calls
DescriptionMany 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.
TagsNo tags attached.
Attached Files

There are no notes attached to this issue.

Issue History
2019-02-04 01:14zsNew Issue
2019-02-04 01:14zsStatusnew => assigned
2019-02-04 01:14zsAssigned To => zs