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

Stepan Dyatkovskiy STPWORLD at narod.ru
Sat Jan 21 00:03:41 PST 2012


Hi Chris. There is no zero arrays created. Probably this patch is not optimal and I'll reworked it today. But the main idea is keep a single zero-item when ConstantAggregateZero was wrapped and return this zero item as result of getOperand call.
Note that wrapper has no parent classes, it has very local and short lifetime (method body), it exists outside the LLVMContext and needed for replacement of isa<ConstantAggregateZero>(C) checks only.

-Stepan

21.01.2012, 08:12, "Chris Lattner" <clattner at apple.com>:
> I'd really rather not do this.  Faking that large zero filled array is represented with ConstantArray means that the compiler will inevitably end up calling getOperand on each of those elements, burning a ton of compile time.



More information about the llvm-dev mailing list