Lines Matching refs:getOperand
40 isa<ConstantInt>(I->getOperand(2))) in CheapToScalarize()
46 (CheapToScalarize(BO->getOperand(0), isConstant) || in CheapToScalarize()
47 CheapToScalarize(BO->getOperand(1), isConstant))) in CheapToScalarize()
51 (CheapToScalarize(CI->getOperand(0), isConstant) || in CheapToScalarize()
52 CheapToScalarize(CI->getOperand(1), isConstant))) in CheapToScalarize()
73 if (!isa<ConstantInt>(III->getOperand(2))) in FindScalarElement()
75 unsigned IIElt = cast<ConstantInt>(III->getOperand(2))->getZExtValue(); in FindScalarElement()
80 return III->getOperand(1); in FindScalarElement()
84 return FindScalarElement(III->getOperand(0), EltNo); in FindScalarElement()
88 unsigned LHSWidth = SVI->getOperand(0)->getType()->getVectorNumElements(); in FindScalarElement()
93 return FindScalarElement(SVI->getOperand(0), InEl); in FindScalarElement()
94 return FindScalarElement(SVI->getOperand(1), InEl - LHSWidth); in FindScalarElement()
111 if (Constant *C = dyn_cast<Constant>(EI.getOperand(0))) in visitExtractElementInst()
117 if (ConstantInt *IdxC = dyn_cast<ConstantInt>(EI.getOperand(1))) { in visitExtractElementInst()
129 if (EI.getOperand(0)->hasOneUse() && VectorWidth != 1) { in visitExtractElementInst()
133 if (Value *V = SimplifyDemandedVectorElts(EI.getOperand(0), in visitExtractElementInst()
140 if (Value *Elt = FindScalarElement(EI.getOperand(0), IndexVal)) in visitExtractElementInst()
146 if (BitCastInst *BCI = dyn_cast<BitCastInst>(EI.getOperand(0))) { in visitExtractElementInst()
147 if (VectorType *VT = dyn_cast<VectorType>(BCI->getOperand(0)->getType())) in visitExtractElementInst()
149 if (Value *Elt = FindScalarElement(BCI->getOperand(0), IndexVal)) in visitExtractElementInst()
154 if (Instruction *I = dyn_cast<Instruction>(EI.getOperand(0))) { in visitExtractElementInst()
159 CheapToScalarize(BO, isa<ConstantInt>(EI.getOperand(1)))) { in visitExtractElementInst()
161 Builder->CreateExtractElement(BO->getOperand(0), EI.getOperand(1), in visitExtractElementInst()
164 Builder->CreateExtractElement(BO->getOperand(1), EI.getOperand(1), in visitExtractElementInst()
170 if (IE->getOperand(2) == EI.getOperand(1)) in visitExtractElementInst()
171 return ReplaceInstUsesWith(EI, IE->getOperand(1)); in visitExtractElementInst()
174 if (isa<Constant>(IE->getOperand(2)) && isa<Constant>(EI.getOperand(1))) { in visitExtractElementInst()
175 Worklist.AddValue(EI.getOperand(0)); in visitExtractElementInst()
176 EI.setOperand(0, IE->getOperand(0)); in visitExtractElementInst()
182 if (ConstantInt *Elt = dyn_cast<ConstantInt>(EI.getOperand(1))) { in visitExtractElementInst()
186 SVI->getOperand(0)->getType()->getVectorNumElements(); in visitExtractElementInst()
191 Src = SVI->getOperand(0); in visitExtractElementInst()
194 Src = SVI->getOperand(1); in visitExtractElementInst()
206 Value *EE = Builder->CreateExtractElement(CI->getOperand(0), in visitExtractElementInst()
244 Value *VecOp = IEI->getOperand(0); in CollectSingleShuffleElements()
245 Value *ScalarOp = IEI->getOperand(1); in CollectSingleShuffleElements()
246 Value *IdxOp = IEI->getOperand(2); in CollectSingleShuffleElements()
261 if (isa<ConstantInt>(EI->getOperand(1)) && in CollectSingleShuffleElements()
262 EI->getOperand(0)->getType() == V->getType()) { in CollectSingleShuffleElements()
264 cast<ConstantInt>(EI->getOperand(1))->getZExtValue(); in CollectSingleShuffleElements()
267 if (EI->getOperand(0) == LHS || EI->getOperand(0) == RHS) { in CollectSingleShuffleElements()
272 if (EI->getOperand(0) == LHS) { in CollectSingleShuffleElements()
277 assert(EI->getOperand(0) == RHS); in CollectSingleShuffleElements()
315 Value *VecOp = IEI->getOperand(0); in CollectShuffleElements()
316 Value *ScalarOp = IEI->getOperand(1); in CollectShuffleElements()
317 Value *IdxOp = IEI->getOperand(2); in CollectShuffleElements()
320 if (isa<ConstantInt>(EI->getOperand(1)) && isa<ConstantInt>(IdxOp) && in CollectShuffleElements()
321 EI->getOperand(0)->getType() == V->getType()) { in CollectShuffleElements()
323 cast<ConstantInt>(EI->getOperand(1))->getZExtValue(); in CollectShuffleElements()
328 if (EI->getOperand(0) == RHS || RHS == 0) { in CollectShuffleElements()
329 RHS = EI->getOperand(0); in CollectShuffleElements()
338 Value *V = CollectShuffleElements(EI->getOperand(0), Mask, RHS); in CollectShuffleElements()
350 if (CollectSingleShuffleElements(IEI, EI->getOperand(0), RHS, Mask)) in CollectShuffleElements()
351 return EI->getOperand(0); in CollectShuffleElements()
364 Value *VecOp = IE.getOperand(0); in visitInsertElementInst()
365 Value *ScalarOp = IE.getOperand(1); in visitInsertElementInst()
366 Value *IdxOp = IE.getOperand(2); in visitInsertElementInst()
375 if (isa<ConstantInt>(EI->getOperand(1)) && isa<ConstantInt>(IdxOp) && in visitInsertElementInst()
376 EI->getOperand(0)->getType() == IE.getType()) { in visitInsertElementInst()
379 cast<ConstantInt>(EI->getOperand(1))->getZExtValue(); in visitInsertElementInst()
390 if (EI->getOperand(0) == VecOp && ExtractedIdx == InsertedIdx) in visitInsertElementInst()
420 Value *LHS = SVI.getOperand(0); in visitShuffleVectorInst()
421 Value *RHS = SVI.getOperand(1); in visitShuffleVectorInst()
427 if (isa<UndefValue>(SVI.getOperand(2))) in visitShuffleVectorInst()
437 LHS = SVI.getOperand(0); in visitShuffleVectorInst()
438 RHS = SVI.getOperand(1); in visitShuffleVectorInst()
472 SVI.setOperand(0, SVI.getOperand(1)); in visitShuffleVectorInst()
475 LHS = SVI.getOperand(0); in visitShuffleVectorInst()
476 RHS = SVI.getOperand(1); in visitShuffleVectorInst()
544 if (!isa<UndefValue>(LHSShuffle->getOperand(1)) && !isa<UndefValue>(RHS)) in visitShuffleVectorInst()
547 if (!isa<UndefValue>(RHSShuffle->getOperand(1))) in visitShuffleVectorInst()
558 LHSOp0 = LHSShuffle->getOperand(0); in visitShuffleVectorInst()
559 LHSOp1 = LHSShuffle->getOperand(1); in visitShuffleVectorInst()
563 RHSOp0 = RHSShuffle->getOperand(0); in visitShuffleVectorInst()
637 assert(isa<UndefValue>(RHSShuffle->getOperand(1)) in visitShuffleVectorInst()