Lines Matching refs:Agg
885 Constant *llvm::ConstantFoldExtractValueInstruction(Constant *Agg,
889 return Agg;
891 if (isa<UndefValue>(Agg)) // ev(undef, x) -> undef
892 return UndefValue::get(ExtractValueInst::getIndexedType(Agg->getType(),
895 if (isa<ConstantAggregateZero>(Agg)) // ev(0, x) -> 0
897 Constant::getNullValue(ExtractValueInst::getIndexedType(Agg->getType(),
901 if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Agg))
905 if (ConstantArray *CA = dyn_cast<ConstantArray>(Agg))
908 ConstantVector *CV = cast<ConstantVector>(Agg);
913 Constant *llvm::ConstantFoldInsertValueInstruction(Constant *Agg,
920 if (isa<UndefValue>(Agg)) {
924 return Agg;
928 CompositeType *AggTy = cast<CompositeType>(Agg->getType());
951 if (isa<ConstantAggregateZero>(Agg)) {
955 return Agg;
959 CompositeType *AggTy = cast<CompositeType>(Agg->getType());
982 if (isa<ConstantStruct>(Agg) || isa<ConstantArray>(Agg)) {
984 std::vector<Constant*> Ops(Agg->getNumOperands());
985 for (unsigned i = 0; i < Agg->getNumOperands(); ++i) {
986 Constant *Op = cast<Constant>(Agg->getOperand(i));
992 if (StructType* ST = dyn_cast<StructType>(Agg->getType()))
994 return ConstantArray::get(cast<ArrayType>(Agg->getType()), Ops);