diff options
author | Björn Gustavsson <[email protected]> | 2019-01-19 06:26:50 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-01-24 10:15:32 +0100 |
commit | 17f9cfaf93f7b46087eff39c4cf4da7b07df5b11 (patch) | |
tree | 3f671b8d5e33a63372d48d1c2a740a205475c2d4 /otp_versions.table | |
parent | a0104bc16c8c6f57c2725d07b811bf3bcb0a2455 (diff) | |
download | otp-17f9cfaf93f7b46087eff39c4cf4da7b07df5b11.tar.gz otp-17f9cfaf93f7b46087eff39c4cf4da7b07df5b11.tar.bz2 otp-17f9cfaf93f7b46087eff39c4cf4da7b07df5b11.zip |
Introduce optimizations of tail phis
Try to eliminate short blocks that starts with a phi node
and end in a return. For example:
Result = phi { Res1, 4 }, { literal true, 5 }
Ret = put_tuple literal ok, Result
ret Ret
The code in this block can be inserted at the end blocks 4 and
5. Thus, the following code can be inserted into block 4:
Ret:1 = put_tuple literal ok, Res1
ret Ret:1
And the following code into block 5:
Ret:2 = put_tuple literal ok, literal true
ret Ret:2
Which can be further simplified to:
ret literal {ok, true}
This transformation may lead to more code improvements, for example:
* Stack trimming
* Fewer test_heap instructions
* Smaller stack frames
Diffstat (limited to 'otp_versions.table')
0 files changed, 0 insertions, 0 deletions