diff options
author | Björn Gustavsson <[email protected]> | 2017-12-13 10:39:22 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-12-15 12:31:28 +0100 |
commit | beb15397b746cb20d00f6585e115ac2a112b18ad (patch) | |
tree | 7e6d9bd72fbc083e839c31517b6374577c89e54a /lib/compiler/src/beam_utils.erl | |
parent | 47f61b16efe9f4304a522f54a4b630a6ffc08b06 (diff) | |
download | otp-beb15397b746cb20d00f6585e115ac2a112b18ad.tar.gz otp-beb15397b746cb20d00f6585e115ac2a112b18ad.tar.bz2 otp-beb15397b746cb20d00f6585e115ac2a112b18ad.zip |
beam_utils: Improve precision for is_not_used/3
Diffstat (limited to 'lib/compiler/src/beam_utils.erl')
-rw-r--r-- | lib/compiler/src/beam_utils.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl index bd1423cb40..6f20fc94de 100644 --- a/lib/compiler/src/beam_utils.erl +++ b/lib/compiler/src/beam_utils.erl @@ -380,9 +380,16 @@ check_liveness(R, [{bs_init,_,_,none,Ss,Dst}|Is], St) -> check_liveness(R, [{bs_init,_,_,Live,Ss,Dst}|Is], St) -> case R of {x,X} -> - case X < Live orelse member(R, Ss) of - true -> {used,St}; - false -> {killed,St} + case member(R, Ss) of + true -> + {used,St}; + false -> + if + X < Live -> + not_used(check_liveness(R, Is, St)); + true -> + {killed,St} + end end; {y,_} -> case member(R, Ss) of |