clangir
clangir copied to clipboard
Leverage `#cir.zero` in large constant strings initializers
The initializer for the null strings should leverage #cir.zero
in some way. The reason for this is to improve performance when facing large zero/prefix-initialized strings. For example:
struct {
char r[100000];
char g[100000];
char b[100000];
} image = {"", "1234", "\0"};
The resulting CIR code for this example consists of three #cir.const_array
s with thousands \00
hexadecimal chars each, making them unnecessarily large.
Originally posted by @sitio-couto in https://github.com/llvm/clangir/pull/244#discussion_r1310242571
We have trailing_zeros
these days, could be use here.
I am going to take this task