This triggers about 50k times during 32 bit make.bash.
Change-Id: Ia0c2b1a8246b92173b4b0d94a4037626f76b6e73
Reviewed-on: https://go-review.googlesource.com/37998
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
(Const32F [f2i(float64(i2f32(c) + i2f32(d)))]) // ensure we combine the operands with 32 bit precision
(Add64F (Const64F [c]) (Const64F [d])) -> (Const64F [f2i(i2f(c) + i2f(d))])
(AddPtr <t> x (Const64 [c])) -> (OffPtr <t> x [c])
+(AddPtr <t> x (Const32 [c])) -> (OffPtr <t> x [c])
(Sub8 (Const8 [c]) (Const8 [d])) -> (Const8 [int64(int8(c-d))])
(Sub16 (Const16 [c]) (Const16 [d])) -> (Const16 [int64(int16(c-d))])
v.AddArg(x)
return true
}
+ // match: (AddPtr <t> x (Const32 [c]))
+ // cond:
+ // result: (OffPtr <t> x [c])
+ for {
+ t := v.Type
+ x := v.Args[0]
+ v_1 := v.Args[1]
+ if v_1.Op != OpConst32 {
+ break
+ }
+ c := v_1.AuxInt
+ v.reset(OpOffPtr)
+ v.Type = t
+ v.AuxInt = c
+ v.AddArg(x)
+ return true
+ }
return false
}
func rewriteValuegeneric_OpAnd16(v *Value, config *Config) bool {