Lines Matching defs:LHS

325 /// elements from either LHS or RHS, return the shuffle mask and true.
327 static bool CollectSingleShuffleElements(Value *V, Value *LHS, Value *RHS,
329 assert(V->getType() == LHS->getType() && V->getType() == RHS->getType() &&
338 if (V == LHS) {
364 if (CollectSingleShuffleElements(VecOp, LHS, RHS, Mask)) {
375 // This must be extracting from either LHS or RHS.
376 if (EI->getOperand(0) == LHS || EI->getOperand(0) == RHS) {
379 if (CollectSingleShuffleElements(VecOp, LHS, RHS, Mask)) {
381 if (EI->getOperand(0) == LHS) {
404 /// that computes V and the LHS value of the shuffle.
511 Value *LHS = CollectShuffleElements(&IE, Mask, RHS);
512 if (RHS == 0) RHS = UndefValue::get(LHS->getType());
513 // We now have a shuffle of LHS, RHS, Mask.
514 return new ShuffleVectorInst(LHS, RHS, ConstantVector::get(Mask));
781 Value *LHS = SVI.getOperand(0);
798 LHS = SVI.getOperand(0);
803 unsigned LHSWidth = cast<VectorType>(LHS->getType())->getNumElements();
807 if (LHS == RHS || isa<UndefValue>(LHS)) {
808 if (isa<UndefValue>(LHS) && LHS == RHS) {
811 ? LHS : UndefValue::get(SVI.getType());
815 // Remap any references to RHS to use LHS.
824 (Mask[i] < (int)e && isa<UndefValue>(LHS))) {
828 Mask[i] = Mask[i] % e; // Force to LHS.
836 LHS = SVI.getOperand(0);
842 // Analyze the shuffle, are the LHS or RHS and identity shuffles?
847 // Is this an identity shuffle of the LHS value?
855 if (isLHSID) return ReplaceInstUsesWith(SVI, LHS);
859 if (isa<UndefValue>(RHS) && CanEvaluateShuffled(LHS, Mask)) {
860 Value *V = EvaluateInDifferentElementOrder(LHS, Mask);
864 // If the LHS is a shufflevector itself, see if we can combine it with this
907 ShuffleVectorInst* LHSShuffle = dyn_cast<ShuffleVectorInst>(LHS);
932 Value* newLHS = LHS;
955 if (newLHS == LHS && newRHS == RHS)
960 if (newLHS != LHS)
965 unsigned newLHSWidth = (newLHS != LHS) ? LHSOp0Width : LHSWidth;
979 // If LHS is going to be replaced (case 1, 2, or 4), calculate the
981 if (newLHS != LHS) {
1010 // If LHS's width is changed, shift the mask value accordingly.