Lines Matching defs:constant
200 // variable in constant address space in OpenCL.
210 // some variables even if we can constant-evaluate them because
211 // we can't guarantee every translation unit will constant-evaluate them.
348 // If constant emission failed, then this should be a C++ static
352 CGM.ErrorUnsupported(D.getInit(), "constant l-value expression");
357 // be constant.
370 assert(VarSize == CstSize && "Emitted constant has unexpected size");
409 // We have a constant initializer, but a nontrivial destructor. We still
478 // We may have to cast the constant because of the initializer
482 // RAUW's the GV uses of this constant will be invalid.
995 /// variable instead of using a memcpy from a constant global. It is beneficial
1014 /// of using a memcpy from a constant global. Assumes we've already decided to
1027 /// Decide whether we want to split a constant structure or array store into a
1043 /// Generate a constant filled with either a pattern or zeroes.
1053 llvm::Constant *constant);
1059 llvm::Constant *constant) {
1074 if (constant->isZeroValue())
1077 CurOp = cast<llvm::Constant>(constant->getAggregateElement(i));
1090 return constant;
1094 /// Replace all padding bytes in a given constant with either a pattern byte or
1097 llvm::Constant *constant) {
1098 llvm::Type *OrigTy = constant->getType();
1100 return constStructWithPadding(CGM, isPattern, STy, constant);
1105 return constant;
1107 bool ZeroInitializer = constant->isNullValue();
1115 OpValue = constant->getAggregateElement(Op);
1122 return constant;
1129 return constant;
1194 llvm::Constant *constant, bool IsAutoInit) {
1195 auto *Ty = constant->getType();
1203 auto *I = Builder.CreateStore(constant, Loc, isVolatile);
1213 if (shouldUseBZeroPlusStoresToInitialize(constant, ConstantSize)) {
1220 constant->isNullValue() || isa<llvm::UndefValue>(constant);
1223 emitStoresForInitAfterBZero(CGM, constant, Loc, isVolatile, Builder,
1231 shouldUseMemSetToInitialize(constant, ConstantSize, CGM.getDataLayout());
1257 for (unsigned i = 0; i != constant->getNumOperands(); i++) {
1263 constant->getAggregateElement(i), IsAutoInit);
1274 constant->getAggregateElement(i), IsAutoInit);
1285 CGM, D, Builder, constant, Loc.getAlignment()),
1295 llvm::Constant *constant =
1297 emitStoresForConstant(CGM, D, Loc, isVolatile, Builder, constant,
1305 llvm::Constant *constant = constWithPadding(
1307 assert(!isa<llvm::UndefValue>(constant));
1308 emitStoresForConstant(CGM, D, Loc, isVolatile, Builder, constant,
1312 static bool containsUndef(llvm::Constant *constant) {
1313 auto *Ty = constant->getType();
1314 if (isa<llvm::UndefValue>(constant))
1317 for (llvm::Use &Op : constant->operands())
1324 llvm::Constant *constant) {
1325 auto *Ty = constant->getType();
1326 if (isa<llvm::UndefValue>(constant))
1329 return constant;
1330 if (!containsUndef(constant))
1331 return constant;
1332 llvm::SmallVector<llvm::Constant *, 8> Values(constant->getNumOperands());
1333 for (unsigned Op = 0, NumOp = constant->getNumOperands(); Op != NumOp; ++Op) {
1334 auto *OpValue = cast<llvm::Constant>(constant->getOperand(Op));
1482 // constant initializer, there are optimizations we can do.
1484 // TODO: We should constant-evaluate the initializer of any variable,
1485 // as long as it is initialized by a constant expression. Currently,
1498 // Exception is if a variable is located in non-constant address space
1812 // VLAs look zero-sized to getTypeInfo. We can't emit constant stores to
1885 // If this was emitted as a global constant, we're done.
1952 llvm::Constant *constant = nullptr;
1955 assert(!capturedByInit && "constant init contains a capturing block?");
1956 constant = ConstantEmitter(*this).tryEmitAbstractForInitializer(D);
1957 if (constant && !constant->isZeroValue() &&
1970 constant = constWithPadding(CGM, IsPattern::No,
1971 replaceUndef(CGM, isPattern, constant));
1977 // Try to fold these back into an integer constant so it can be stored
1980 D.getType(), constant->getType());
1981 constant = llvm::ConstantFoldLoadFromConst(
1982 constant, LoadType, llvm::APInt::getZero(32), CGM.getDataLayout());
1986 if (!constant) {
1989 // At this point, we know D has an Init expression, but isn't a constant.
2011 return EmitStoreThroughLValue(RValue::get(constant), lv, true);
2015 type.isVolatileQualified(), Builder, constant,
2142 // If this was emitted as a global constant, we're done.
2339 // But if the array length is constant, we can suppress that.
2341 // ...and if it's constant zero, we can just skip the entire thing.