Home | History | Annotate | Download | only in InstCombine

Lines Matching defs:RHS

165                                         EI.getName()+".rhs");
216 /// elements from either LHS or RHS, return the shuffle mask and true.
218 static bool CollectSingleShuffleElements(Value *V, Value *LHS, Value *RHS,
220 assert(V->getType() == LHS->getType() && V->getType() == RHS->getType() &&
235 if (V == RHS) {
255 if (CollectSingleShuffleElements(VecOp, LHS, RHS, Mask)) {
266 // This must be extracting from either LHS or RHS.
267 if (EI->getOperand(0) == LHS || EI->getOperand(0) == RHS) {
270 if (CollectSingleShuffleElements(VecOp, LHS, RHS, Mask)) {
277 assert(EI->getOperand(0) == RHS);
293 /// CollectShuffleElements - We are building a shuffle of V, using RHS as the
294 /// RHS of the shuffle instruction, if it is not null. Return a shuffle mask
297 Value *&RHS) {
299 (RHS == 0 || V->getType() == RHS->getType()) &&
328 if (EI->getOperand(0) == RHS || RHS == 0) {
329 RHS = EI->getOperand(0);
330 Value *V = CollectShuffleElements(VecOp, Mask, RHS);
337 if (VecOp == RHS) {
338 Value *V = CollectShuffleElements(EI->getOperand(0), Mask, RHS);
339 // Everything but the extracted element is replaced with the RHS.
350 if (CollectSingleShuffleElements(IEI, EI->getOperand(0), RHS, Mask))
397 Value *RHS = 0;
398 Value *LHS = CollectShuffleElements(&IE, Mask, RHS);
399 if (RHS == 0) RHS = UndefValue::get(LHS->getType());
400 // We now have a shuffle of LHS, RHS, Mask.
401 return new ShuffleVectorInst(LHS, RHS, ConstantVector::get(Mask));
421 Value *RHS = SVI.getOperand(1);
438 RHS = SVI.getOperand(1);
446 if (LHS == RHS || isa<UndefValue>(LHS)) {
447 if (isa<UndefValue>(LHS) && LHS == RHS) {
454 // Remap any references to RHS to use LHS.
462 if ((Mask[i] >= (int)e && isa<UndefValue>(RHS)) ||
473 SVI.setOperand(1, UndefValue::get(RHS->getType()));
476 RHS = SVI.getOperand(1);
481 // Analyze the shuffle, are the LHS or RHS and identity shuffles?
489 // Is this an identity shuffle of the RHS value?
495 if (isRHSID) return ReplaceInstUsesWith(SVI, RHS);
542 ShuffleVectorInst* RHSShuffle = dyn_cast<ShuffleVectorInst>(RHS);
544 if (!isa<UndefValue>(LHSShuffle->getOperand(1)) && !isa<UndefValue>(RHS))
567 Value* newRHS = RHS;
570 if (isa<UndefValue>(RHS)) {
589 if (newLHS == LHS && newRHS == RHS)
596 if (RHSShuffle && newRHS != RHS)
628 if (isa<UndefValue>(RHS))
630 // If RHS is going to be replaced (case 3 or 4), calculate the
632 else if (newRHS != RHS) {