[LLVMdev] How to force the creation of arrays with zeroes?

Anton Korobeynikov anton at korobeynikov.info
Fri Jan 20 02:41:22 PST 2012


> you can't, you can only get a ConstantAggregateZero.  This is actually kind of
> annoying, and means that places expecting a ConstantArray have to remember to
> also check for ConstantAggregateZero.  Perhaps there's a good reason for the
> current design, but if not it would be great to eliminate this wart.
Well, I think the main reason it so reduce the size of .ll / .bc when
all operands are zero.
If the array / struct is really big then this can save a lot of space.

-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University




More information about the llvm-dev mailing list