CGBuilderTy &Builder,
llvm::Constant *constant) {
auto *Ty = constant->getType();
+ uint64_t ConstantSize = CGM.getDataLayout().getTypeAllocSize(Ty);
+ if (!ConstantSize)
+ return;
+
bool canDoSingleStore = Ty->isIntOrIntVectorTy() ||
Ty->isPtrOrPtrVectorTy() || Ty->isFPOrFPVectorTy();
if (canDoSingleStore) {
return;
}
- uint64_t ConstantSize = CGM.getDataLayout().getTypeAllocSize(Ty);
- if (!ConstantSize)
- return;
auto *SizeVal = llvm::ConstantInt::get(CGM.IntPtrTy, ConstantSize);
// If the initializer is all or mostly the same, codegen with bzero / memset