Commit Graph

5 Commits

Author SHA1 Message Date
Erik Eckstein
2d95f4993a GlobalOpt/IRGen: Instead of not converting an array of empty elements to a statically initialized array, handle this special case in IRGen. 2017-10-31 17:14:51 -07:00
Erik Eckstein
fb935a3d49 SIL: support statically initialized StaticString globals
The main part of the change is to support the ptr_to_int builtin in statically initialized globals. This builtin is used to build a StaticString from a string_literal.
On the other hand I removed the support of the FPTrunc builtin, which is not needed anyway (because it can be constant propagated).
2017-09-18 17:50:24 -07:00
Erik Eckstein
cbcde4ed35 GlobalOpt: don't convert arrays with empty element type into statically initialized objects
This doesn't play well with the minimum stride of 1 for empty types.
2017-08-30 14:24:15 -07:00
Erik Eckstein
0e742ca81a tests: fix for 32-bit target 2017-08-24 14:36:19 -07:00
Erik Eckstein
66e7d8864f GlobalOpt: Outline heap objects to global variables.
Mainly this is done for array literals.
This new optimization creates a statically initialized global variable which is the allocated object.
The alloc_ref instruction is replaced by a global_value instruction.

This optimization can give significant performance improvements for large array literals.
2017-08-23 09:15:49 -07:00