Lines Matching defs:SVI

544     } else if (auto *SVI = dyn_cast<ShuffleVectorInst>(I)) {
548 if (isa<FixedVectorType>(SVI->getType()) && isa<ConstantInt>(Index)) {
550 SVI->getMaskValue(cast<ConstantInt>(Index)->getZExtValue());
552 unsigned LHSWidth = cast<FixedVectorType>(SVI->getOperand(0)->getType())
558 Src = SVI->getOperand(0);
561 Src = SVI->getOperand(1);
2099 static bool isShuffleExtractingFromLHS(ShuffleVectorInst &SVI,
2102 cast<FixedVectorType>(SVI.getOperand(0)->getType())->getNumElements();
2830 Instruction *InstCombinerImpl::simplifyBinOpSplats(ShuffleVectorInst &SVI) {
2831 if (!match(SVI.getOperand(1), m_Poison()) ||
2832 !match(SVI.getShuffleMask(), m_ZeroMask()) ||
2833 !SVI.getOperand(0)->hasOneUse())
2836 Value *Op0 = SVI.getOperand(0);
2854 return new ShuffleVectorInst(NewBO, SVI.getShuffleMask());
2857 Instruction *InstCombinerImpl::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
2858 Value *LHS = SVI.getOperand(0);
2859 Value *RHS = SVI.getOperand(1);
2860 SimplifyQuery ShufQuery = SQ.getWithInstruction(&SVI);
2861 if (auto *V = simplifyShuffleVectorInst(LHS, RHS, SVI.getShuffleMask(),
2862 SVI.getType(), ShufQuery))
2863 return replaceInstUsesWith(SVI, V);
2865 if (Instruction *I = simplifyBinOpSplats(SVI))
2870 if (match(SVI.getShuffleMask(), m_ZeroMask()) && !isa<PoisonValue>(RHS))
2871 return replaceOperand(SVI, 1, PoisonValue::get(RHS->getType()));
2876 unsigned VWidth = cast<FixedVectorType>(SVI.getType())->getNumElements();
2890 SVI.getType()->getScalarSizeInBits() &&
2892 Value *V = Builder.CreateShuffleVector(X, Y, SVI.getShuffleMask(),
2893 SVI.getName() + ".uncasted");
2894 return new BitCastInst(V, SVI.getType());
2897 ArrayRef<int> Mask = SVI.getShuffleMask();
2916 return BitCastInst::Create(Instruction::BitCast, V, SVI.getType());
2929 SVI.commute();
2930 return &SVI;
2933 if (Instruction *I = canonicalizeInsertSplat(SVI, Builder))
2936 if (Instruction *I = foldSelectShuffle(SVI))
2939 if (Instruction *I = foldTruncShuffle(SVI, DL.isBigEndian()))
2942 if (Instruction *I = narrowVectorSelect(SVI, Builder))
2945 if (Instruction *I = foldShuffleOfUnaryOps(SVI, Builder))
2948 if (Instruction *I = foldCastShuffle(SVI, Builder))
2953 if (Value *V = SimplifyDemandedVectorElts(&SVI, AllOnesEltMask, PoisonElts)) {
2954 if (V != &SVI)
2955 return replaceInstUsesWith(SVI, V);
2956 return &SVI;
2959 if (Instruction *I = foldIdentityExtractShuffle(SVI))
2964 if (Instruction *I = foldShuffleWithInsert(SVI, *this))
2966 if (Instruction *I = foldIdentityPaddedShuffles(SVI))
2976 if (Instruction *I = FoldOpIntoSelect(SVI, SI))
2981 if (Instruction *I = foldOpIntoPhi(SVI, PN, /*AllowMultipleUses=*/true))
2988 return replaceInstUsesWith(SVI, V);
3021 if (isShuffleExtractingFromLHS(SVI, Mask)) {
3031 for (User *U : SVI.users())
3057 SVI.getName() + ".extract");
3065 It->second = Builder.CreateBitCast(V, CastSrcTy, SVI.getName() + ".bc");
3067 SVI.getName() + ".extract");
3128 return MadeChange ? &SVI : nullptr;
3168 return MadeChange ? &SVI : nullptr;
3250 return MadeChange ? &SVI : nullptr;