Lines Matching refs:Agg
882 Constant *llvm::ConstantFoldExtractValueInstruction(Constant *Agg, in ConstantFoldExtractValueInstruction() argument
886 return Agg; in ConstantFoldExtractValueInstruction()
888 if (isa<UndefValue>(Agg)) // ev(undef, x) -> undef in ConstantFoldExtractValueInstruction()
889 return UndefValue::get(ExtractValueInst::getIndexedType(Agg->getType(), in ConstantFoldExtractValueInstruction()
892 if (isa<ConstantAggregateZero>(Agg)) // ev(0, x) -> 0 in ConstantFoldExtractValueInstruction()
894 Constant::getNullValue(ExtractValueInst::getIndexedType(Agg->getType(), in ConstantFoldExtractValueInstruction()
898 if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Agg)) in ConstantFoldExtractValueInstruction()
902 if (ConstantArray *CA = dyn_cast<ConstantArray>(Agg)) in ConstantFoldExtractValueInstruction()
905 ConstantVector *CV = cast<ConstantVector>(Agg); in ConstantFoldExtractValueInstruction()
910 Constant *llvm::ConstantFoldInsertValueInstruction(Constant *Agg, in ConstantFoldInsertValueInstruction() argument
917 if (isa<UndefValue>(Agg)) { in ConstantFoldInsertValueInstruction()
921 return Agg; in ConstantFoldInsertValueInstruction()
925 CompositeType *AggTy = cast<CompositeType>(Agg->getType()); in ConstantFoldInsertValueInstruction()
948 if (isa<ConstantAggregateZero>(Agg)) { in ConstantFoldInsertValueInstruction()
952 return Agg; in ConstantFoldInsertValueInstruction()
956 CompositeType *AggTy = cast<CompositeType>(Agg->getType()); in ConstantFoldInsertValueInstruction()
979 if (isa<ConstantStruct>(Agg) || isa<ConstantArray>(Agg)) { in ConstantFoldInsertValueInstruction()
981 std::vector<Constant*> Ops(Agg->getNumOperands()); in ConstantFoldInsertValueInstruction()
982 for (unsigned i = 0; i < Agg->getNumOperands(); ++i) { in ConstantFoldInsertValueInstruction()
983 Constant *Op = cast<Constant>(Agg->getOperand(i)); in ConstantFoldInsertValueInstruction()
989 if (StructType* ST = dyn_cast<StructType>(Agg->getType())) in ConstantFoldInsertValueInstruction()
991 return ConstantArray::get(cast<ArrayType>(Agg->getType()), Ops); in ConstantFoldInsertValueInstruction()