Lines Matching refs:Mask
331 SmallVectorImpl<Constant*> &Mask) { in CollectSingleShuffleElements() argument
337 Mask.assign(NumElts, UndefValue::get(Type::getInt32Ty(V->getContext()))); in CollectSingleShuffleElements()
343 Mask.push_back(ConstantInt::get(Type::getInt32Ty(V->getContext()), i)); in CollectSingleShuffleElements()
349 Mask.push_back(ConstantInt::get(Type::getInt32Ty(V->getContext()), in CollectSingleShuffleElements()
367 if (CollectSingleShuffleElements(VecOp, LHS, RHS, Mask)) { in CollectSingleShuffleElements()
369 Mask[InsertedIdx] = UndefValue::get(Type::getInt32Ty(V->getContext())); in CollectSingleShuffleElements()
382 if (CollectSingleShuffleElements(VecOp, LHS, RHS, Mask)) { in CollectSingleShuffleElements()
385 Mask[InsertedIdx % NumElts] = in CollectSingleShuffleElements()
390 Mask[InsertedIdx % NumElts] = in CollectSingleShuffleElements()
416 SmallVectorImpl<Constant *> &Mask, in CollectShuffleElements() argument
422 Mask.assign(NumElts, UndefValue::get(Type::getInt32Ty(V->getContext()))); in CollectShuffleElements()
428 Mask.assign(NumElts, ConstantInt::get(Type::getInt32Ty(V->getContext()),0)); in CollectShuffleElements()
448 ShuffleOps LR = CollectShuffleElements(VecOp, Mask, RHS); in CollectShuffleElements()
455 Mask[i] = ConstantInt::get(Type::getInt32Ty(V->getContext()), i); in CollectShuffleElements()
460 Mask[InsertedIdx % NumElts] = in CollectShuffleElements()
472 Mask.push_back(ConstantInt::get( in CollectShuffleElements()
482 Mask)) in CollectShuffleElements()
490 Mask.push_back(ConstantInt::get(Type::getInt32Ty(V->getContext()), i)); in CollectShuffleElements()
563 SmallVector<Constant*, 16> Mask; in visitInsertElementInst() local
564 ShuffleOps LR = CollectShuffleElements(&IE, Mask, nullptr); in visitInsertElementInst()
573 ConstantVector::get(Mask)); in visitInsertElementInst()
593 static bool CanEvaluateShuffled(Value *V, ArrayRef<int> Mask, in CanEvaluateShuffled() argument
641 if (!CanEvaluateShuffled(I->getOperand(i), Mask, Depth-1)) in CanEvaluateShuffled()
654 for (int i = 0, e = Mask.size(); i != e; ++i) { in CanEvaluateShuffled()
655 if (Mask[i] == ElementNumber) { in CanEvaluateShuffled()
661 return CanEvaluateShuffled(I->getOperand(0), Mask, Depth-1); in CanEvaluateShuffled()
746 InstCombiner::EvaluateInDifferentElementOrder(Value *V, ArrayRef<int> Mask) { in EvaluateInDifferentElementOrder() argument
752 Mask.size())); in EvaluateInDifferentElementOrder()
757 Mask.size())); in EvaluateInDifferentElementOrder()
761 for (int i = 0, e = Mask.size(); i != e; ++i) { in EvaluateInDifferentElementOrder()
762 if (Mask[i] == -1) in EvaluateInDifferentElementOrder()
765 MaskValues.push_back(Builder->getInt32(Mask[i])); in EvaluateInDifferentElementOrder()
805 bool NeedsRebuild = (Mask.size() != I->getType()->getVectorNumElements()); in EvaluateInDifferentElementOrder()
807 Value *V = EvaluateInDifferentElementOrder(I->getOperand(i), Mask); in EvaluateInDifferentElementOrder()
824 for (int e = Mask.size(); Index != e; ++Index) { in EvaluateInDifferentElementOrder()
825 if (Mask[Index] == Element) { in EvaluateInDifferentElementOrder()
834 return EvaluateInDifferentElementOrder(I->getOperand(0), Mask); in EvaluateInDifferentElementOrder()
836 Value *V = EvaluateInDifferentElementOrder(I->getOperand(0), Mask); in EvaluateInDifferentElementOrder()
844 static void RecognizeIdentityMask(const SmallVectorImpl<int> &Mask, in RecognizeIdentityMask() argument
848 for (unsigned i = 0, e = Mask.size(); i != e; ++i) { in RecognizeIdentityMask()
849 if (Mask[i] < 0) continue; // Ignore undef values. in RecognizeIdentityMask()
851 isLHSID &= (Mask[i] == (int)i); in RecognizeIdentityMask()
854 isRHSID &= (Mask[i]-e == i); in RecognizeIdentityMask()
865 SmallVector<int, 16> &Mask) { in isShuffleExtractingFromLHS() argument
868 unsigned MaskElems = Mask.size(); in isShuffleExtractingFromLHS()
869 unsigned BegIdx = Mask.front(); in isShuffleExtractingFromLHS()
870 unsigned EndIdx = Mask.back(); in isShuffleExtractingFromLHS()
874 if (static_cast<unsigned>(Mask[I]) != BegIdx + I) in isShuffleExtractingFromLHS()
882 SmallVector<int, 16> Mask = SVI.getShuffleMask(); in visitShuffleVectorInst() local
918 if (Mask[i] < 0) { in visitShuffleVectorInst()
923 if ((Mask[i] >= (int)e && isa<UndefValue>(RHS)) || in visitShuffleVectorInst()
924 (Mask[i] < (int)e && isa<UndefValue>(LHS))) { in visitShuffleVectorInst()
925 Mask[i] = -1; // Turn into undef. in visitShuffleVectorInst()
928 Mask[i] = Mask[i] % e; // Force to LHS. in visitShuffleVectorInst()
929 Elts.push_back(ConstantInt::get(Int32Ty, Mask[i])); in visitShuffleVectorInst()
943 RecognizeIdentityMask(Mask, isLHSID, isRHSID); in visitShuffleVectorInst()
950 if (isa<UndefValue>(RHS) && CanEvaluateShuffled(LHS, Mask)) { in visitShuffleVectorInst()
951 Value *V = EvaluateInDifferentElementOrder(LHS, Mask); in visitShuffleVectorInst()
984 if (isShuffleExtractingFromLHS(SVI, Mask)) { in visitShuffleVectorInst()
986 unsigned MaskElems = Mask.size(); in visitShuffleVectorInst()
987 unsigned BegIdx = Mask.front(); in visitShuffleVectorInst()
1153 if (Mask[i] < 0) { in visitShuffleVectorInst()
1156 } else if (Mask[i] < (int)LHSWidth) { in visitShuffleVectorInst()
1162 eltMask = LHSMask[Mask[i]]; in visitShuffleVectorInst()
1168 eltMask = Mask[i]; in visitShuffleVectorInst()
1179 eltMask = RHSMask[Mask[i]-LHSWidth]; in visitShuffleVectorInst()
1188 eltMask = Mask[i]-LHSWidth; in visitShuffleVectorInst()
1212 if (isSplat || newMask == LHSMask || newMask == RHSMask || newMask == Mask) { in visitShuffleVectorInst()