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()
484 Instruction *FirstInst = cast<Instruction>(PN.getIncomingValue(0)); in FoldPHIArgOpIntoPHI() local
486 if (isa<GetElementPtrInst>(FirstInst)) in FoldPHIArgOpIntoPHI()
488 if (isa<LoadInst>(FirstInst)) in FoldPHIArgOpIntoPHI()
499 if (isa<CastInst>(FirstInst)) { in FoldPHIArgOpIntoPHI()
500 CastSrcTy = FirstInst->getOperand(0)->getType(); in FoldPHIArgOpIntoPHI()
508 } else if (isa<BinaryOperator>(FirstInst) || isa<CmpInst>(FirstInst)) { in FoldPHIArgOpIntoPHI()
511 ConstantOp = dyn_cast<Constant>(FirstInst->getOperand(1)); in FoldPHIArgOpIntoPHI()
516 dyn_cast<OverflowingBinaryOperator>(FirstInst)) { in FoldPHIArgOpIntoPHI()
520 dyn_cast<PossiblyExactOperator>(FirstInst)) in FoldPHIArgOpIntoPHI()
529 if (!I || !I->hasOneUse() || !I->isSameOperationAs(FirstInst)) in FoldPHIArgOpIntoPHI()
548 PHINode *NewPN = PHINode::Create(FirstInst->getOperand(0)->getType(), in FoldPHIArgOpIntoPHI()
552 Value *InVal = FirstInst->getOperand(0); in FoldPHIArgOpIntoPHI()
575 if (CastInst *FirstCI = dyn_cast<CastInst>(FirstInst)) { in FoldPHIArgOpIntoPHI()
578 NewCI->setDebugLoc(FirstInst->getDebugLoc()); in FoldPHIArgOpIntoPHI()
582 if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(FirstInst)) { in FoldPHIArgOpIntoPHI()
587 BinOp->setDebugLoc(FirstInst->getDebugLoc()); in FoldPHIArgOpIntoPHI()
591 CmpInst *CIOp = cast<CmpInst>(FirstInst); in FoldPHIArgOpIntoPHI()
594 NewCI->setDebugLoc(FirstInst->getDebugLoc()); in FoldPHIArgOpIntoPHI()