Lines Matching refs:FirstInst
26 Instruction *FirstInst = cast<Instruction>(PN.getIncomingValue(0)); in FoldPHIArgBinOpIntoPHI() local
27 assert(isa<BinaryOperator>(FirstInst) || isa<CmpInst>(FirstInst)); in FoldPHIArgBinOpIntoPHI()
28 unsigned Opc = FirstInst->getOpcode(); in FoldPHIArgBinOpIntoPHI()
29 Value *LHSVal = FirstInst->getOperand(0); in FoldPHIArgBinOpIntoPHI()
30 Value *RHSVal = FirstInst->getOperand(1); in FoldPHIArgBinOpIntoPHI()
37 dyn_cast<OverflowingBinaryOperator>(FirstInst)) { in FoldPHIArgBinOpIntoPHI()
41 dyn_cast<PossiblyExactOperator>(FirstInst)) in FoldPHIArgBinOpIntoPHI()
56 if (CI->getPredicate() != cast<CmpInst>(FirstInst)->getPredicate()) in FoldPHIArgBinOpIntoPHI()
80 Value *InLHS = FirstInst->getOperand(0); in FoldPHIArgBinOpIntoPHI()
81 Value *InRHS = FirstInst->getOperand(1); in FoldPHIArgBinOpIntoPHI()
85 FirstInst->getOperand(0)->getName() + ".pn"); in FoldPHIArgBinOpIntoPHI()
93 FirstInst->getOperand(1)->getName() + ".pn"); in FoldPHIArgBinOpIntoPHI()
114 if (CmpInst *CIOp = dyn_cast<CmpInst>(FirstInst)) { in FoldPHIArgBinOpIntoPHI()
117 NewCI->setDebugLoc(FirstInst->getDebugLoc()); in FoldPHIArgBinOpIntoPHI()
121 BinaryOperator *BinOp = cast<BinaryOperator>(FirstInst); in FoldPHIArgBinOpIntoPHI()
127 NewBinOp->setDebugLoc(FirstInst->getDebugLoc()); in FoldPHIArgBinOpIntoPHI()
132 GetElementPtrInst *FirstInst =cast<GetElementPtrInst>(PN.getIncomingValue(0)); in FoldPHIArgGEPIntoPHI() local
134 SmallVector<Value*, 16> FixedOperands(FirstInst->op_begin(), in FoldPHIArgGEPIntoPHI()
135 FirstInst->op_end()); in FoldPHIArgGEPIntoPHI()
150 if (!GEP || !GEP->hasOneUse() || GEP->getType() != FirstInst->getType() || in FoldPHIArgGEPIntoPHI()
151 GEP->getNumOperands() != FirstInst->getNumOperands()) in FoldPHIArgGEPIntoPHI()
163 for (unsigned op = 0, e = FirstInst->getNumOperands(); op != e; ++op) { in FoldPHIArgGEPIntoPHI()
164 if (FirstInst->getOperand(op) == GEP->getOperand(op)) in FoldPHIArgGEPIntoPHI()
172 if (isa<ConstantInt>(FirstInst->getOperand(op)) || in FoldPHIArgGEPIntoPHI()
176 if (FirstInst->getOperand(op)->getType() !=GEP->getOperand(op)->getType()) in FoldPHIArgGEPIntoPHI()
207 Value *FirstOp = FirstInst->getOperand(i); in FoldPHIArgGEPIntoPHI()
233 GetElementPtrInst::Create(FirstInst->getSourceElementType(), Base, in FoldPHIArgGEPIntoPHI()
236 NewGEP->setDebugLoc(FirstInst->getDebugLoc()); in FoldPHIArgGEPIntoPHI()
392 Instruction *FirstInst = cast<Instruction>(PN.getIncomingValue(0)); in FoldPHIArgOpIntoPHI() local
394 if (isa<GetElementPtrInst>(FirstInst)) in FoldPHIArgOpIntoPHI()
396 if (isa<LoadInst>(FirstInst)) in FoldPHIArgOpIntoPHI()
407 if (isa<CastInst>(FirstInst)) { in FoldPHIArgOpIntoPHI()
408 CastSrcTy = FirstInst->getOperand(0)->getType(); in FoldPHIArgOpIntoPHI()
416 } else if (isa<BinaryOperator>(FirstInst) || isa<CmpInst>(FirstInst)) { in FoldPHIArgOpIntoPHI()
419 ConstantOp = dyn_cast<Constant>(FirstInst->getOperand(1)); in FoldPHIArgOpIntoPHI()
424 dyn_cast<OverflowingBinaryOperator>(FirstInst)) { in FoldPHIArgOpIntoPHI()
428 dyn_cast<PossiblyExactOperator>(FirstInst)) in FoldPHIArgOpIntoPHI()
437 if (!I || !I->hasOneUse() || !I->isSameOperationAs(FirstInst)) in FoldPHIArgOpIntoPHI()
456 PHINode *NewPN = PHINode::Create(FirstInst->getOperand(0)->getType(), in FoldPHIArgOpIntoPHI()
460 Value *InVal = FirstInst->getOperand(0); in FoldPHIArgOpIntoPHI()
483 if (CastInst *FirstCI = dyn_cast<CastInst>(FirstInst)) { in FoldPHIArgOpIntoPHI()
486 NewCI->setDebugLoc(FirstInst->getDebugLoc()); in FoldPHIArgOpIntoPHI()
490 if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(FirstInst)) { in FoldPHIArgOpIntoPHI()
495 BinOp->setDebugLoc(FirstInst->getDebugLoc()); in FoldPHIArgOpIntoPHI()
499 CmpInst *CIOp = cast<CmpInst>(FirstInst); in FoldPHIArgOpIntoPHI()
502 NewCI->setDebugLoc(FirstInst->getDebugLoc()); in FoldPHIArgOpIntoPHI()