aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-01-21 07:35:55 +0100
committerJohn Högberg <[email protected]>2019-01-21 07:51:06 +0100
commit2d96971a96868d70a750422788d1493a5cbed605 (patch)
tree0a415ee73d923ce86bab5ed42b62fb97906fc33f /lib/compiler/src
parentb46fe99e5fa3d96f0ae647f11956e5777d6bb1fe (diff)
downloadotp-2d96971a96868d70a750422788d1493a5cbed605.tar.gz
otp-2d96971a96868d70a750422788d1493a5cbed605.tar.bz2
otp-2d96971a96868d70a750422788d1493a5cbed605.zip
beam_ssa_type: Remove wait_timeout instructions with a timeout of 0
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/beam_ssa_type.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_ssa_type.erl b/lib/compiler/src/beam_ssa_type.erl
index ede57875e2..7ef49fee64 100644
--- a/lib/compiler/src/beam_ssa_type.erl
+++ b/lib/compiler/src/beam_ssa_type.erl
@@ -309,6 +309,8 @@ simplify(#b_set{op=put_tuple,args=Args}=I, _Ts) ->
none -> I;
List -> #b_literal{val=list_to_tuple(List)}
end;
+simplify(#b_set{op=wait_timeout,args=[#b_literal{val=0}]}, _Ts) ->
+ #b_literal{val=true};
simplify(#b_set{op=wait_timeout,args=[#b_literal{val=infinity}]}=I, _Ts) ->
I#b_set{op=wait,args=[]};
simplify(I, _Ts) -> I.