• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/llvmCore-3425.0.33/lib/Transforms/InstCombine/

Lines Matching refs:EI

99 Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) {
100 // If vector val is constant with all elements the same, replace EI with
102 if (Constant *C = dyn_cast<Constant>(EI.getOperand(0)))
104 return ReplaceInstUsesWith(EI, C->getAggregateElement(0U));
108 if (ConstantInt *IdxC = dyn_cast<ConstantInt>(EI.getOperand(1))) {
110 unsigned VectorWidth = EI.getVectorOperandType()->getNumElements();
115 return ReplaceInstUsesWith(EI, UndefValue::get(EI.getType()));
120 if (EI.getOperand(0)->hasOneUse() && VectorWidth != 1) {
124 if (Value *V = SimplifyDemandedVectorElts(EI.getOperand(0),
126 EI.setOperand(0, V);
127 return &EI;
131 if (Value *Elt = FindScalarElement(EI.getOperand(0), IndexVal))
132 return ReplaceInstUsesWith(EI, Elt);
137 if (BitCastInst *BCI = dyn_cast<BitCastInst>(EI.getOperand(0))) {
141 return new BitCastInst(Elt, EI.getType());
145 if (Instruction *I = dyn_cast<Instruction>(EI.getOperand(0))) {
150 CheapToScalarize(BO, isa<ConstantInt>(EI.getOperand(1)))) {
152 Builder->CreateExtractElement(BO->getOperand(0), EI.getOperand(1),
153 EI.getName()+".lhs");
155 Builder->CreateExtractElement(BO->getOperand(1), EI.getOperand(1),
156 EI.getName()+".rhs");
161 if (IE->getOperand(2) == EI.getOperand(1))
162 return ReplaceInstUsesWith(EI, IE->getOperand(1));
165 if (isa<Constant>(IE->getOperand(2)) && isa<Constant>(EI.getOperand(1))) {
166 Worklist.AddValue(EI.getOperand(0));
167 EI.setOperand(0, IE->getOperand(0));
168 return &EI;
173 if (ConstantInt *Elt = dyn_cast<ConstantInt>(EI.getOperand(1))) {
180 return ReplaceInstUsesWith(EI, UndefValue::get(EI.getType()));
187 Type *Int32Ty = Type::getInt32Ty(EI.getContext());
195 if (CI->hasOneUse() && EI.hasOneUse() &&
198 EI.getIndexOperand());
199 return CastInst::Create(CI->getOpcode(), EE, EI.getType());
251 } else if (ExtractElementInst *EI = dyn_cast<ExtractElementInst>(ScalarOp)){
252 if (isa<ConstantInt>(EI->getOperand(1)) &&
253 EI->getOperand(0)->getType() == V->getType()) {
255 cast<ConstantInt>(EI->getOperand(1))->getZExtValue();
258 if (EI->getOperand(0) == LHS || EI->getOperand(0) == RHS) {
263 if (EI->getOperand(0) == LHS) {
268 assert(EI->getOperand(0) == RHS);
310 if (ExtractElementInst *EI = dyn_cast<ExtractElementInst>(ScalarOp)) {
311 if (isa<ConstantInt>(EI->getOperand(1)) && isa<ConstantInt>(IdxOp) &&
312 EI->getOperand(0)->getType() == V->getType()) {
314 cast<ConstantInt>(EI->getOperand(1))->getZExtValue();
319 if (EI->getOperand(0) == RHS || RHS == 0) {
320 RHS = EI->getOperand(0);
329 Value *V = CollectShuffleElements(EI->getOperand(0), Mask, RHS);
341 if (CollectSingleShuffleElements(IEI, EI->getOperand(0), RHS, Mask))
342 return EI->getOperand(0);
365 if (ExtractElementInst *EI = dyn_cast<ExtractElementInst>(ScalarOp)) {
366 if (isa<ConstantInt>(EI->getOperand(1)) && isa<ConstantInt>(IdxOp) &&
367 EI->getOperand(0)->getType() == IE.getType()) {
370 cast<ConstantInt>(EI->getOperand(1))->getZExtValue();
381 if (EI->getOperand(0) == VecOp && ExtractedIdx == InsertedIdx)