julia icon indicating copy to clipboard operation
julia copied to clipboard

optimizer: inline constant `String` return value

Open aviatesk opened this issue 2 years ago • 3 comments

The purpose of is_inlineable_constant is to avoid code size increases from copying objects too much. Strings would be fine since they are generally copied around by reference only.

aviatesk avatar Jul 28 '22 23:07 aviatesk

should this only happen for short string?

oscardssmith avatar Jul 28 '22 23:07 oscardssmith

I think String are (always?) copied by reference whatever size it has. Is this understanding correct, @Keno or @vtjnash ?

aviatesk avatar Aug 05 '22 06:08 aviatesk

That's the theory of it, but we should make sure that when we're compressing or serializing IR, we don't accidentally copy the strings around.

Keno avatar Aug 05 '22 06:08 Keno