aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/x86/hipe_x86_postpass.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-10-02 14:20:41 +0200
committerMagnus Lång <[email protected]>2016-11-16 17:22:04 +0100
commit6b7c73196936d94f2a03a465c0954fc9dbf35974 (patch)
tree932e4b31aacda9c4ce243eea73378f7685adc589 /lib/hipe/x86/hipe_x86_postpass.erl
parentfda8d7909594d434c01fdc9610127d09d1499a43 (diff)
downloadotp-6b7c73196936d94f2a03a465c0954fc9dbf35974.tar.gz
otp-6b7c73196936d94f2a03a465c0954fc9dbf35974.tar.bz2
otp-6b7c73196936d94f2a03a465c0954fc9dbf35974.zip
hipe_x86_postpass: Negate conditions in goto elim
Diffstat (limited to 'lib/hipe/x86/hipe_x86_postpass.erl')
-rw-r--r--lib/hipe/x86/hipe_x86_postpass.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/hipe/x86/hipe_x86_postpass.erl b/lib/hipe/x86/hipe_x86_postpass.erl
index 390f5bf5e7..f88a841cca 100644
--- a/lib/hipe/x86/hipe_x86_postpass.erl
+++ b/lib/hipe/x86/hipe_x86_postpass.erl
@@ -217,6 +217,11 @@ trivial_goto_elimination(Insns) -> goto_elim(Insns, []).
goto_elim([#jmp_label{label=Label}, I = #label{label=Label}|Insns], Res) ->
goto_elim([I|Insns], Res);
+goto_elim([#jcc{cc=CC, label=Label} = IJCC,
+ #jmp_label{label=BranchTgt},
+ #label{label=Label} = ILBL|Insns], Res) ->
+ goto_elim([IJCC#jcc{cc=hipe_x86:neg_cc(CC), label=BranchTgt},
+ ILBL|Insns], Res);
goto_elim([I | Insns], Res) ->
goto_elim(Insns, [I|Res]);
goto_elim([], Res) ->