Home | History | Annotate | Download | only in InstCombine

Lines Matching refs:SVI

225     } else if (ShuffleVectorInst *SVI = dyn_cast<ShuffleVectorInst>(I)) {
229 int SrcIdx = SVI->getMaskValue(Elt->getZExtValue());
232 SVI->getOperand(0)->getType()->getVectorNumElements();
237 Src = SVI->getOperand(0);
240 Src = SVI->getOperand(1);
904 static bool isShuffleExtractingFromLHS(ShuffleVectorInst &SVI,
907 cast<VectorType>(SVI.getOperand(0)->getType())->getNumElements();
919 Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
920 Value *LHS = SVI.getOperand(0);
921 Value *RHS = SVI.getOperand(1);
922 SmallVector<int, 16> Mask = SVI.getShuffleMask();
923 Type *Int32Ty = Type::getInt32Ty(SVI.getContext());
928 if (isa<UndefValue>(SVI.getOperand(2)))
929 return replaceInstUsesWith(SVI, UndefValue::get(SVI.getType()));
931 unsigned VWidth = cast<VectorType>(SVI.getType())->getNumElements();
935 if (Value *V = SimplifyDemandedVectorElts(&SVI, AllOnesEltMask, UndefElts)) {
936 if (V != &SVI)
937 return replaceInstUsesWith(SVI, V);
938 LHS = SVI.getOperand(0);
939 RHS = SVI.getOperand(1);
951 ? LHS : UndefValue::get(SVI.getType());
952 return replaceInstUsesWith(SVI, Result);
972 SVI.setOperand(0, SVI.getOperand(1));
973 SVI.setOperand(1, UndefValue::get(RHS->getType()));
974 SVI.setOperand(2, ConstantVector::get(Elts));
975 LHS = SVI.getOperand(0);
976 RHS = SVI.getOperand(1);
986 if (isLHSID) return replaceInstUsesWith(SVI, LHS);
987 if (isRHSID) return replaceInstUsesWith(SVI, RHS);
992 return replaceInstUsesWith(SVI, V);
1024 if (isShuffleExtractingFromLHS(SVI, Mask)) {
1035 for (User *U : SVI.users())
1062 SVI.getName() + ".extract");
1072 : Builder->CreateBitCast(V, CastSrcTy, SVI.getName() + ".bc");
1076 NewBC, ConstantInt::get(Int32Ty, BegIdx), SVI.getName() + ".extract");
1136 return MadeChange ? &SVI : nullptr;
1176 return MadeChange ? &SVI : nullptr;
1270 if (isLHSID && VWidth == LHSOp0Width) return replaceInstUsesWith(SVI, newLHS);
1271 if (isRHSID && VWidth == RHSOp0Width) return replaceInstUsesWith(SVI, newRHS);
1273 return MadeChange ? &SVI : nullptr;