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()))
1279 static Instruction *foldInsSequenceIntoSplat(InsertElementInst &InsElt) {
1282 if (InsElt.hasOneUse() && isa<InsertElementInst>(InsElt.user_back()))
1285 VectorType *VecTy = InsElt.getType();
1297 Value *SplatVal = InsElt.getOperand(1);
1298 InsertElementInst *CurrIE = &InsElt;
1313 if (CurrIE != &InsElt &&
1323 if (FirstIE == &InsElt)
1335 Type *Int64Ty = Type::getInt64Ty(InsElt.getContext());
1340 InsElt.getIterator());
1353 static Instruction *foldInsEltIntoSplat(InsertElementInst &InsElt) {
1355 auto *Shuf = dyn_cast<ShuffleVectorInst>(InsElt.getOperand(0));
1366 if (!match(InsElt.getOperand(2), m_ConstantInt(IdxC)))
1370 Value *X = InsElt.getOperand(1);
1390 static Instruction *foldInsEltIntoIdentityShuffle(InsertElementInst &InsElt) {
1392 auto *Shuf = dyn_cast<ShuffleVectorInst>(InsElt.getOperand(0));
1404 if (!match(InsElt.getOperand(2), m_ConstantInt(IdxC)))
1409 Value *Scalar = InsElt.getOperand(1);
1472 static Instruction *foldConstantInsEltIntoShuffle(InsertElementInst &InsElt) {
1473 auto *Inst = dyn_cast<Instruction>(InsElt.getOperand(0));
1478 if (auto *Shuf = dyn_cast<ShuffleVectorInst>(InsElt.getOperand(0))) {
1484 !match(InsElt.getOperand(1), m_Constant(InsEltScalar)) ||
1485 !match(InsElt.getOperand(2), m_ConstantInt(InsEltIndex)))
1532 if (isa<ScalableVectorType>(InsElt.getType()))
1535 cast<FixedVectorType>(InsElt.getType())->getNumElements();
1539 if (!match(InsElt.getOperand(2), m_ConstantInt(InsertIdx[0])) ||
1540 !match(InsElt.getOperand(1), m_Constant(Val[0])) ||
1560 Values[I] = PoisonValue::get(InsElt.getType()->getElementType());
1576 static Instruction *narrowInsElt(InsertElementInst &InsElt,
1582 Value *Vec = InsElt.getOperand(0);
1586 Value *Scalar = InsElt.getOperand(1);
1603 Value *NewInsElt = Builder.CreateInsertElement(X, Y, InsElt.getOperand(2));
1604 return CastInst::Create(CastOpcode, NewInsElt, InsElt.getType());
1609 static Instruction *foldTruncInsEltPair(InsertElementInst &InsElt,
1612 Value *VecOp = InsElt.getOperand(0);
1613 Value *ScalarOp = InsElt.getOperand(1);
1614 Value *IndexOp = InsElt.getOperand(2);
1626 auto *VTy = dyn_cast<FixedVectorType>(InsElt.getType());