[Yul] ExpressionInliner: avoid duplicating high cost expressions

This commit is contained in:
mingchuan
2019-08-05 11:48:32 +02:00
committed by chriseth
parent 29d47d5c3c
commit 46387eaea2
4 changed files with 68 additions and 17 deletions
+4 -2
View File
@@ -38,7 +38,10 @@ struct Dialect;
* - have a body like r := <functional expression>
* - neither reference themselves nor r in the right hand side
*
* Furthermore, the arguments of the function call cannot have any side-effects.
* Furthermore, for all parameters, all of the following need to be true
* - the argument is movable
* - the parameter is either referenced less than twice in the function body, or the argument is rather cheap
* ("cost" of at most 1 like a constant up to 0xff)
*
* This component can only be used on sources with unique names.
*/
@@ -66,5 +69,4 @@ private:
Dialect const& m_dialect;
};
}