aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/_gen/generic.rules
diff options
context:
space:
mode:
authorJorropo <jorropo.pgm@gmail.com>2026-03-29 07:10:47 +0200
committerGopher Robot <gobot@golang.org>2026-04-06 10:05:00 -0700
commit24596d3243ba0a9d855d1ede30245ba00d7f1962 (patch)
tree5b98664f120ee8d2838c5a20401dca2b5a1f2729 /src/cmd/compile/internal/ssa/_gen/generic.rules
parent68ee544e8704b657e0adab5d3c2af38212f3d6c4 (diff)
downloadgo-24596d3243ba0a9d855d1ede30245ba00d7f1962.tar.xz
cmd/compile: cleanup rules by canonicalizing sext(int(bool)) → zext(int(bool))
Change-Id: Ic97f661c68180ff7adb9976fcc61279e1e1f04a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/760842 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/_gen/generic.rules')
-rw-r--r--src/cmd/compile/internal/ssa/_gen/generic.rules7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/ssa/_gen/generic.rules b/src/cmd/compile/internal/ssa/_gen/generic.rules
index 5ceadd79a1..24c7975390 100644
--- a/src/cmd/compile/internal/ssa/_gen/generic.rules
+++ b/src/cmd/compile/internal/ssa/_gen/generic.rules
@@ -2358,7 +2358,6 @@
(Neq(64|32|16) (ZeroExt8to(64|32|16) (CvtBoolToUint8 x)) (Const(64|32|16) [1])) => (Not x)
(Eq(64|32|16) (ZeroExt8to(64|32|16) (CvtBoolToUint8 x)) (Const(64|32|16) [1])) => x
(Eq(64|32|16) (ZeroExt8to(64|32|16) (CvtBoolToUint8 x)) (Const(64|32|16) [0])) => (Not x)
-(Neq(64|32|16) (SignExt8to(64|32|16) (CvtBoolToUint8 x)) (Const(64|32|16) [0])) => x
-(Neq(64|32|16) (SignExt8to(64|32|16) (CvtBoolToUint8 x)) (Const(64|32|16) [1])) => (Not x)
-(Eq(64|32|16) (SignExt8to(64|32|16) (CvtBoolToUint8 x)) (Const(64|32|16) [1])) => x
-(Eq(64|32|16) (SignExt8to(64|32|16) (CvtBoolToUint8 x)) (Const(64|32|16) [0])) => (Not x)
+
+// Canonicalize sext(int(bool)) => zext(int(bool))
+(SignExt8to(64|32|16) cvt:(CvtBoolToUint8 bool)) => (ZeroExt8to(64|32|16) cvt)