Lines Matching refs:SVI
91 if (ShuffleVectorInst *SVI = dyn_cast<ShuffleVectorInst>(V)) {
92 unsigned LHSWidth = SVI->getOperand(0)->getType()->getVectorNumElements();
93 int InEl = SVI->getMaskValue(EltNo);
97 return FindScalarElement(SVI->getOperand(0), InEl);
98 return FindScalarElement(SVI->getOperand(1), InEl - LHSWidth);
258 } else if (ShuffleVectorInst *SVI = dyn_cast<ShuffleVectorInst>(I)) {
262 int SrcIdx = SVI->getMaskValue(Elt->getZExtValue());
265 SVI->getOperand(0)->getType()->getVectorNumElements();
270 Src = SVI->getOperand(0);
273 Src = SVI->getOperand(1);
856 Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
857 Value *LHS = SVI.getOperand(0);
858 Value *RHS = SVI.getOperand(1);
859 SmallVector<int, 16> Mask = SVI.getShuffleMask();
864 if (isa<UndefValue>(SVI.getOperand(2)))
865 return ReplaceInstUsesWith(SVI, UndefValue::get(SVI.getType()));
867 unsigned VWidth = cast<VectorType>(SVI.getType())->getNumElements();
871 if (Value *V = SimplifyDemandedVectorElts(&SVI, AllOnesEltMask, UndefElts)) {
872 if (V != &SVI)
873 return ReplaceInstUsesWith(SVI, V);
874 LHS = SVI.getOperand(0);
875 RHS = SVI.getOperand(1);
887 ? LHS : UndefValue::get(SVI.getType());
888 return ReplaceInstUsesWith(SVI, Result);
895 Elts.push_back(UndefValue::get(Type::getInt32Ty(SVI.getContext())));
902 Elts.push_back(UndefValue::get(Type::getInt32Ty(SVI.getContext())));
905 Elts.push_back(ConstantInt::get(Type::getInt32Ty(SVI.getContext()),
909 SVI.setOperand(0, SVI.getOperand(1));
910 SVI.setOperand(1, UndefValue::get(RHS->getType()));
911 SVI.setOperand(2, ConstantVector::get(Elts));
912 LHS = SVI.getOperand(0);
913 RHS = SVI.getOperand(1);
923 if (isLHSID) return ReplaceInstUsesWith(SVI, LHS);
924 if (isRHSID) return ReplaceInstUsesWith(SVI, RHS);
929 return ReplaceInstUsesWith(SVI, V);
984 return MadeChange ? &SVI : nullptr;
1024 return MadeChange ? &SVI : nullptr;
1102 Type *Int32Ty = Type::getInt32Ty(SVI.getContext());
1119 if (isLHSID && VWidth == LHSOp0Width) return ReplaceInstUsesWith(SVI, newLHS);
1120 if (isRHSID && VWidth == RHSOp0Width) return ReplaceInstUsesWith(SVI, newRHS);
1122 return MadeChange ? &SVI : nullptr;