From 35755d772fab1828c9b79563b98912f3c6025b7a Mon Sep 17 00:00:00 2001 From: Jorropo Date: Sun, 4 Dec 2022 21:41:47 +0100 Subject: cmd/compile: teach prove about unsigned division, modulus and rsh Fixes: #57077 Change-Id: Icffcac42e28622eadecdba26e3cd7ceca6c4aacc Reviewed-on: https://go-review.googlesource.com/c/go/+/455095 Reviewed-by: Keith Randall Reviewed-by: Keith Randall Auto-Submit: Keith Randall TryBot-Result: Gopher Robot Run-TryBot: Keith Randall Reviewed-by: David Chase --- src/cmd/compile/internal/ssa/prove.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/cmd/compile/internal/ssa/prove.go b/src/cmd/compile/internal/ssa/prove.go index 908fb5af46..89098e411b 100644 --- a/src/cmd/compile/internal/ssa/prove.go +++ b/src/cmd/compile/internal/ssa/prove.go @@ -859,6 +859,15 @@ func prove(f *Func) { case OpOr64, OpOr32, OpOr16, OpOr8: ft.update(b, v, v.Args[1], unsigned, gt|eq) ft.update(b, v, v.Args[0], unsigned, gt|eq) + case OpDiv64u, OpDiv32u, OpDiv16u, OpDiv8u, + OpRsh8Ux64, OpRsh8Ux32, OpRsh8Ux16, OpRsh8Ux8, + OpRsh16Ux64, OpRsh16Ux32, OpRsh16Ux16, OpRsh16Ux8, + OpRsh32Ux64, OpRsh32Ux32, OpRsh32Ux16, OpRsh32Ux8, + OpRsh64Ux64, OpRsh64Ux32, OpRsh64Ux16, OpRsh64Ux8: + ft.update(b, v, v.Args[0], unsigned, lt|eq) + case OpMod64u, OpMod32u, OpMod16u, OpMod8u: + ft.update(b, v, v.Args[0], unsigned, lt|eq) + ft.update(b, v, v.Args[1], unsigned, lt) case OpPhi: // Determine the min and max value of OpPhi composed entirely of integer constants. // -- cgit v1.3