compiler: stack allocate a buffer for non-escaping string ops

For string concatenation, string to/from byte or rune slice
conversion, and int to string conversion, if the result does not
escape, we can allocate a small (32-element, or 4-byte for int to
string) buffer on stack, and pass it to the runtime function. If
the result fits in the buffer, it doesn't need to do a heap
allocation.

Change-Id: I2d4394087d9bd525f879bee40c2243cad6b93196
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182538
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2 files changed