commit | 991036aef38cea57c2a7ef02220754d93799c489 | [log] [tgz] |
---|---|---|
author | Todd Neal <todd@tneal.org> | Thu Sep 03 18:24:22 2015 -0500 |
committer | Todd Neal <todd@tneal.org> | Fri Sep 04 14:53:44 2015 +0000 |
tree | af06234cddf769eaf778689012b61603dc436b63 | |
parent | d9f2cafb5050fd264777f175ceb2576d734b7360 [diff] [blame] |
[dev.ssa] cmd/compile: store bools in AuxInt Store bools in AuxInt to reduce allocations. Change-Id: Ibd26db67fca5e1e2803f53d7ef094897968b704b Reviewed-on: https://go-review.googlesource.com/14276 Reviewed-by: Keith Randall <khr@golang.org>
diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go index f2c8972..2742a5c 100644 --- a/src/cmd/compile/internal/ssa/rewrite.go +++ b/src/cmd/compile/internal/ssa/rewrite.go
@@ -162,3 +162,11 @@ func is32Bit(n int64) bool { return n == int64(int32(n)) } + +// b2i translates a boolean value to 0 or 1 for assigning to auxInt. +func b2i(b bool) int64 { + if b { + return 1 + } + return 0 +}