Lines Matching refs:LHS

327 /// elements from either LHS or RHS, return the shuffle mask and true.
329 static bool CollectSingleShuffleElements(Value *V, Value *LHS, Value *RHS,
331 assert(LHS->getType() == RHS->getType() &&
340 if (V == LHS) {
366 if (CollectSingleShuffleElements(VecOp, LHS, RHS, Mask)) {
375 unsigned NumLHSElts = LHS->getType()->getVectorNumElements();
377 // This must be extracting from either LHS or RHS.
378 if (EI->getOperand(0) == LHS || EI->getOperand(0) == RHS) {
381 if (CollectSingleShuffleElements(VecOp, LHS, RHS, Mask)) {
383 if (EI->getOperand(0) == LHS) {
568 // We now have a shuffle of LHS, RHS, Mask.
848 // Is this an identity shuffle of the LHS value?
857 Value *LHS = SVI.getOperand(0);
874 LHS = SVI.getOperand(0);
879 unsigned LHSWidth = cast<VectorType>(LHS->getType())->getNumElements();
883 if (LHS == RHS || isa<UndefValue>(LHS)) {
884 if (isa<UndefValue>(LHS) && LHS == RHS) {
887 ? LHS : UndefValue::get(SVI.getType());
891 // Remap any references to RHS to use LHS.
900 (Mask[i] < (int)e && isa<UndefValue>(LHS))) {
904 Mask[i] = Mask[i] % e; // Force to LHS.
912 LHS = SVI.getOperand(0);
918 // Analyze the shuffle, are the LHS or RHS and identity shuffles?
923 if (isLHSID) return ReplaceInstUsesWith(SVI, LHS);
927 if (isa<UndefValue>(RHS) && CanEvaluateShuffled(LHS, Mask)) {
928 Value *V = EvaluateInDifferentElementOrder(LHS, Mask);
932 // If the LHS is a shufflevector itself, see if we can combine it with this
975 ShuffleVectorInst* LHSShuffle = dyn_cast<ShuffleVectorInst>(LHS);
1000 Value* newLHS = LHS;
1023 if (newLHS == LHS && newRHS == RHS)
1028 if (newLHS != LHS)
1033 unsigned newLHSWidth = (newLHS != LHS) ? LHSOp0Width : LHSWidth;
1047 // If LHS is going to be replaced (case 1, 2, or 4), calculate the
1049 if (newLHS != LHS) {
1078 // If LHS's width is changed, shift the mask value accordingly.