Commit 0d910180 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

[dev.ssa] cmd/compile: add simplifying block rewrite rules

Change-Id: Ia946c259628f84dc7031171456563975d2ad5ea9
Reviewed-on: https://go-review.googlesource.com/13381Reviewed-by: 's avatarKeith Randall <khr@golang.org>
parent b14b8d6b
...@@ -231,18 +231,30 @@ ...@@ -231,18 +231,30 @@
(ITab (Load ptr mem)) -> (MOVQload ptr mem) (ITab (Load ptr mem)) -> (MOVQload ptr mem)
// block rewrites // block rewrites
(If (SETL cmp) yes no) -> (LT cmp yes no) (If (SETL cmp) yes no) -> (LT cmp yes no)
(If (SETLE cmp) yes no) -> (LE cmp yes no) (If (SETLE cmp) yes no) -> (LE cmp yes no)
(If (SETG cmp) yes no) -> (GT cmp yes no) (If (SETG cmp) yes no) -> (GT cmp yes no)
(If (SETGE cmp) yes no) -> (GE cmp yes no) (If (SETGE cmp) yes no) -> (GE cmp yes no)
(If (SETEQ cmp) yes no) -> (EQ cmp yes no) (If (SETEQ cmp) yes no) -> (EQ cmp yes no)
(If (SETNE cmp) yes no) -> (NE cmp yes no) (If (SETNE cmp) yes no) -> (NE cmp yes no)
(If (SETB cmp) yes no) -> (ULT cmp yes no) (If (SETB cmp) yes no) -> (ULT cmp yes no)
(If (SETBE cmp) yes no) -> (ULE cmp yes no) (If (SETBE cmp) yes no) -> (ULE cmp yes no)
(If (SETA cmp) yes no) -> (UGT cmp yes no) (If (SETA cmp) yes no) -> (UGT cmp yes no)
(If (SETAE cmp) yes no) -> (UGE cmp yes no) (If (SETAE cmp) yes no) -> (UGE cmp yes no)
(If cond yes no) -> (NE (TESTB <TypeFlags> cond cond) yes no) (If cond yes no) -> (NE (TESTB <TypeFlags> cond cond) yes no)
(NE (TESTB (SETL cmp)) yes no) -> (LT cmp yes no)
(NE (TESTB (SETLE cmp)) yes no) -> (LE cmp yes no)
(NE (TESTB (SETG cmp)) yes no) -> (GT cmp yes no)
(NE (TESTB (SETGE cmp)) yes no) -> (GE cmp yes no)
(NE (TESTB (SETEQ cmp)) yes no) -> (EQ cmp yes no)
(NE (TESTB (SETNE cmp)) yes no) -> (NE cmp yes no)
(NE (TESTB (SETB cmp)) yes no) -> (ULT cmp yes no)
(NE (TESTB (SETBE cmp)) yes no) -> (ULE cmp yes no)
(NE (TESTB (SETA cmp)) yes no) -> (UGT cmp yes no)
(NE (TESTB (SETAE cmp)) yes no) -> (UGE cmp yes no)
(StaticCall [argwid] {target} mem) -> (CALLstatic [argwid] {target} mem) (StaticCall [argwid] {target} mem) -> (CALLstatic [argwid] {target} mem)
(ClosureCall [argwid] entry closure mem) -> (CALLclosure [argwid] entry closure mem) (ClosureCall [argwid] entry closure mem) -> (CALLclosure [argwid] entry closure mem)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment