diff options
author | Magnus Lång <[email protected]> | 2016-10-02 13:14:40 +0200 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2017-03-02 14:49:14 +0100 |
commit | 200473bc4874a12485ba0b6c681c3648cb8aa355 (patch) | |
tree | 04a1fe099040e97755e0e3327e95cad57290abe2 /lib/hipe/rtl/hipe_icode2rtl.erl | |
parent | 2117c9e01ed2949b245c8f41c00cac2619a5041a (diff) | |
download | otp-200473bc4874a12485ba0b6c681c3648cb8aa355.tar.gz otp-200473bc4874a12485ba0b6c681c3648cb8aa355.tar.bz2 otp-200473bc4874a12485ba0b6c681c3648cb8aa355.zip |
hipe_rtl: Inline more of match eq test
With this change, both the matches and does not match cases have
fastpaths that does not need to call primops.
Diffstat (limited to 'lib/hipe/rtl/hipe_icode2rtl.erl')
-rw-r--r-- | lib/hipe/rtl/hipe_icode2rtl.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/hipe/rtl/hipe_icode2rtl.erl b/lib/hipe/rtl/hipe_icode2rtl.erl index 82970f04ab..6da8a76d34 100644 --- a/lib/hipe/rtl/hipe_icode2rtl.erl +++ b/lib/hipe/rtl/hipe_icode2rtl.erl @@ -532,8 +532,12 @@ gen_cond(CondOp, Args, TrueLbl, FalseLbl, Pred) -> FalseLbl, Pred)]; '=:=' -> [Arg1, Arg2] = Args, + TypeTestLbl = hipe_rtl:mk_new_label(), [hipe_rtl:mk_branch(Arg1, eq, Arg2, TrueLbl, - hipe_rtl:label_name(GenLbl), Pred), + hipe_rtl:label_name(TypeTestLbl), Pred), + TypeTestLbl, + hipe_tagscheme:test_either_immed(Arg1, Arg2, FalseLbl, + hipe_rtl:label_name(GenLbl)), GenLbl, hipe_rtl:mk_call([Tmp], op_exact_eqeq_2, Args, TestRetName, [], not_remote), @@ -546,8 +550,12 @@ gen_cond(CondOp, Args, TrueLbl, FalseLbl, Pred) -> TrueLbl, 1-Pred)]; '=/=' -> [Arg1, Arg2] = Args, + TypeTestLbl = hipe_rtl:mk_new_label(), [hipe_rtl:mk_branch(Arg1, eq, Arg2, FalseLbl, - hipe_rtl:label_name(GenLbl), 1-Pred), + hipe_rtl:label_name(TypeTestLbl), 1-Pred), + TypeTestLbl, + hipe_tagscheme:test_either_immed(Arg1, Arg2, TrueLbl, + hipe_rtl:label_name(GenLbl)), GenLbl, hipe_rtl:mk_call([Tmp], op_exact_eqeq_2, Args, TestRetName, [], not_remote), |