fix expansion cost of pure functions
commit95f38ba85df2f2a7deab6f7feadbba3e9cdca9c1
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Thu, 16 Feb 2017 15:45:32 +0000 (16 16:45 +0100)
committerChristopher Li <sparse@chrisli.org>
Sun, 26 Feb 2017 16:56:37 +0000 (27 00:56 +0800)
tree8539e58aa84310b9f104b42051f6c18fd274e93b
parentf5777926bee11409ee09f04a8b22137b64d5eca1
fix expansion cost of pure functions

Expansion cost of an expression should be a monotonically
increasing function of its sub-expressions.

Here, for the costs of calling a pure function, the costs is
reset to zero (wich is used when the expression expand to
a constant/to test if the expression is a constant or not).

Fix this by setting the cost as the total expansion cost of
all the arguments plus one for the function itself.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
expand.c