search for: constorzero

Displaying 4 results from an estimated 4 matches for "constorzero".

2012 Jan 20
2
[LLVMdev] How to force the creation of arrays with zeroes?
...ts. Consider next code: Constant* C = reinterpret_cast<Constant*>(I->getOperand(idx)); Constant* ArrayItem; if (!isa<ConstantAggregateZero>(C)) ArrayItem = reinterpret_cast<Constant*>(I->getOperand(ArrItemIdx)); else ArrayItem = ZeroInt; Code analog within wrapper: ConstOrZero C(I->getOperand(idx)); Constant* ArrayItem = C.getOperand(ArrItemIdx); // Unpleasant work with isa<> inside. Advantages of this approach is that ConstantAggregateZero saves memory and we use it everywhere. And in the same time we needn't dance with isa<ConstantAggregateZero>....
2012 Jan 21
0
[LLVMdev] How to force the creation of arrays with zeroes?
...einterpret_cast<Constant*>(I->getOperand(idx)); > Constant* ArrayItem; > if (!isa<ConstantAggregateZero>(C)) > ArrayItem = reinterpret_cast<Constant*>(I->getOperand(ArrItemIdx)); > else > ArrayItem = ZeroInt; > > Code analog within wrapper: > > ConstOrZero C(I->getOperand(idx)); > Constant* ArrayItem = C.getOperand(ArrItemIdx); // Unpleasant work with isa<> inside. > > Advantages of this approach is that ConstantAggregateZero saves memory and we use it everywhere. > And in the same time we needn't dance with isa<ConstantA...
2012 Jan 20
0
[LLVMdev] How to force the creation of arrays with zeroes?
Hi Anton, >> 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
2012 Jan 20
2
[LLVMdev] How to force the creation of arrays with zeroes?
> 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