Lines Matching defs:InsElt
694 static bool replaceExtractElements(InsertElementInst *InsElt,
697 auto *InsVecType = cast<FixedVectorType>(InsElt->getType());
732 if (InsertionBlock != InsElt->getParent())
740 if (InsElt->hasOneUse() && isa<InsertElementInst>(InsElt->user_back()))
1213 static Instruction *foldInsSequenceIntoSplat(InsertElementInst &InsElt) {
1216 if (InsElt.hasOneUse() && isa<InsertElementInst>(InsElt.user_back()))
1219 VectorType *VecTy = InsElt.getType();
1231 Value *SplatVal = InsElt.getOperand(1);
1232 InsertElementInst *CurrIE = &InsElt;
1247 if (CurrIE != &InsElt &&
1257 if (FirstIE == &InsElt)
1269 Type *Int64Ty = Type::getInt64Ty(InsElt.getContext());
1274 InsElt.getIterator());
1287 static Instruction *foldInsEltIntoSplat(InsertElementInst &InsElt) {
1289 auto *Shuf = dyn_cast<ShuffleVectorInst>(InsElt.getOperand(0));
1300 if (!match(InsElt.getOperand(2), m_ConstantInt(IdxC)))
1304 Value *X = InsElt.getOperand(1);
1324 static Instruction *foldInsEltIntoIdentityShuffle(InsertElementInst &InsElt) {
1326 auto *Shuf = dyn_cast<ShuffleVectorInst>(InsElt.getOperand(0));
1338 if (!match(InsElt.getOperand(2), m_ConstantInt(IdxC)))
1343 Value *Scalar = InsElt.getOperand(1);
1406 static Instruction *foldConstantInsEltIntoShuffle(InsertElementInst &InsElt) {
1407 auto *Inst = dyn_cast<Instruction>(InsElt.getOperand(0));
1412 if (auto *Shuf = dyn_cast<ShuffleVectorInst>(InsElt.getOperand(0))) {
1418 !match(InsElt.getOperand(1), m_Constant(InsEltScalar)) ||
1419 !match(InsElt.getOperand(2), m_ConstantInt(InsEltIndex)))
1466 if (isa<ScalableVectorType>(InsElt.getType()))
1469 cast<FixedVectorType>(InsElt.getType())->getNumElements();
1473 if (!match(InsElt.getOperand(2), m_ConstantInt(InsertIdx[0])) ||
1474 !match(InsElt.getOperand(1), m_Constant(Val[0])) ||
1494 Values[I] = PoisonValue::get(InsElt.getType()->getElementType());
1510 static Instruction *narrowInsElt(InsertElementInst &InsElt,
1516 Value *Vec = InsElt.getOperand(0);
1520 Value *Scalar = InsElt.getOperand(1);
1537 Value *NewInsElt = Builder.CreateInsertElement(X, Y, InsElt.getOperand(2));
1538 return CastInst::Create(CastOpcode, NewInsElt, InsElt.getType());
1543 static Instruction *foldTruncInsEltPair(InsertElementInst &InsElt,
1546 Value *VecOp = InsElt.getOperand(0);
1547 Value *ScalarOp = InsElt.getOperand(1);
1548 Value *IndexOp = InsElt.getOperand(2);
1560 auto *VTy = dyn_cast<FixedVectorType>(InsElt.getType());