Lines Matching refs:Instruction
167 typedef SmallVector<Instruction *, 16> SmallInstructionVector;
168 typedef SmallSet<Instruction *, 16> SmallInstructionSet;
171 DenseMap<Instruction *, int64_t> IVToIncMap;
177 SimpleLoopReduction(Instruction *P, Loop *L) in SimpleLoopReduction()
187 Instruction *getPHI() const { in getPHI()
192 Instruction *getReducedValue() const { in getReducedValue()
197 Instruction *get(size_t i) const { in get()
202 Instruction *operator [] (size_t i) const { return get(i); } in operator []()
264 for (Instruction *J : PossibleReds[i]) { in restrictToScale()
275 bool isPairInSame(Instruction *J1, Instruction *J2) { in isPairInSame()
276 DenseMap<Instruction *, int>::iterator J1I = PossibleRedIdx.find(J1); in isPairInSame()
278 DenseMap<Instruction *, int>::iterator J2I = PossibleRedIdx.find(J2); in isPairInSame()
289 void recordPair(Instruction *J1, Instruction *J2, unsigned i) { in recordPair()
314 DenseMap<Instruction *, int> PossibleRedIdx;
315 DenseMap<Instruction *, int> PossibleRedIter;
346 Instruction *BaseInst;
355 DAGRootTracker(LoopReroll *Parent, Loop *L, Instruction *IV, in DAGRootTracker()
359 DenseMap<Instruction *, int64_t> &IncrMap) in DAGRootTracker()
373 typedef MapVector<Instruction*, SmallBitVector> UsesTy;
375 bool findRootsRecursive(Instruction *IVU,
377 bool findRootsBase(Instruction *IVU, SmallInstructionSet SubsumedInsts);
378 bool collectPossibleRoots(Instruction *Base,
379 std::map<int64_t,Instruction*> &Roots);
385 DenseSet<Instruction *> &Users);
386 void collectInLoopUserSet(Instruction *Root,
389 DenseSet<Instruction *> &Users);
394 bool isBaseInst(Instruction *I);
395 bool isRootInst(Instruction *I);
396 bool instrDependsOn(Instruction *I,
412 Instruction *IV;
428 DenseMap<Instruction *, int64_t> &IVToIncMap;
434 bool reroll(Instruction *IV, Loop *L, BasicBlock *Header, const SCEV *IterCount,
455 static bool hasUsesOutsideLoop(Instruction *I, Loop *L) { in hasUsesOutsideLoop()
457 if (!L->contains(cast<Instruction>(U))) in hasUsesOutsideLoop()
504 Instruction *C = Instructions.front(); in add()
509 C = cast<Instruction>(*C->user_begin()); in add()
530 if (L->contains(cast<Instruction>(U))) in add()
531 if (cast<Instruction>(U) != Instructions.front()) in add()
573 Instruction *Root, const SmallInstructionSet &Exclude, in collectInLoopUserSet()
575 DenseSet<Instruction *> &Users) { in collectInLoopUserSet()
578 Instruction *I = Queue.pop_back_val(); in collectInLoopUserSet()
584 Instruction *User = cast<Instruction>(U.getUser()); in collectInLoopUserSet()
599 if (Instruction *Op = dyn_cast<Instruction>(*OI)) in collectInLoopUserSet()
613 DenseSet<Instruction *> &Users) { in collectInLoopUserSet()
619 static bool isSimpleLoadStore(Instruction *I) { in isSimpleLoadStore()
633 if (Instruction *I = dyn_cast<Instruction>(IVU)) { in isSimpleArithmeticOp()
636 case Instruction::Add: in isSimpleArithmeticOp()
637 case Instruction::Sub: in isSimpleArithmeticOp()
638 case Instruction::Mul: in isSimpleArithmeticOp()
639 case Instruction::Shl: in isSimpleArithmeticOp()
640 case Instruction::AShr: in isSimpleArithmeticOp()
641 case Instruction::LShr: in isSimpleArithmeticOp()
642 case Instruction::GetElementPtr: in isSimpleArithmeticOp()
643 case Instruction::Trunc: in isSimpleArithmeticOp()
644 case Instruction::ZExt: in isSimpleArithmeticOp()
645 case Instruction::SExt: in isSimpleArithmeticOp()
652 static bool isLoopIncrement(User *U, Instruction *IV) { in isLoopIncrement()
654 if (!BO || BO->getOpcode() != Instruction::Add) in isLoopIncrement()
666 collectPossibleRoots(Instruction *Base, std::map<int64_t,Instruction*> &Roots) { in collectPossibleRoots()
673 LoopIncs.push_back(cast<Instruction>(I)); in collectPossibleRoots()
679 if (BO->getOpcode() == Instruction::Add || in collectPossibleRoots()
680 BO->getOpcode() == Instruction::Or) in collectPossibleRoots()
688 if (Instruction *II = dyn_cast<Instruction>(I)) { in collectPossibleRoots()
702 Roots[V] = cast<Instruction>(I); in collectPossibleRoots()
740 findRootsRecursive(Instruction *I, SmallInstructionSet SubsumedInsts) { in findRootsRecursive()
746 if ((I->getOpcode() == Instruction::Mul || in findRootsRecursive()
747 I->getOpcode() == Instruction::PHI) && in findRootsRecursive()
755 Instruction *I = dyn_cast<Instruction>(V); in findRootsRecursive()
767 findRootsBase(Instruction *IVU, SmallInstructionSet SubsumedInsts) { in findRootsBase()
771 if (IVU->getOpcode() != Instruction::Mul && in findRootsBase()
772 IVU->getOpcode() != Instruction::PHI) in findRootsBase()
775 std::map<int64_t, Instruction*> V; in findRootsBase()
816 LoopIncs.push_back(cast<Instruction>(IVU)); in findRoots()
894 DenseSet<Instruction*> VBase; in collectUsedInstructions()
902 DenseSet<Instruction*> V; in collectUsedInstructions()
932 DenseSet<Instruction*> V; in collectUsedInstructions()
956 bool LoopReroll::DAGRootTracker::isBaseInst(Instruction *I) { in isBaseInst()
964 bool LoopReroll::DAGRootTracker::isRootInst(Instruction *I) { in isRootInst()
974 bool LoopReroll::DAGRootTracker::instrDependsOn(Instruction *I, in instrDependsOn()
985 static bool isIgnorableInst(const Instruction *I) { in isIgnorableInst()
1067 Instruction *BaseInst = BaseIt->first; in validate()
1068 Instruction *RootInst = RootIt->first; in validate()
1125 Instruction *I = LastRootIt->first; in validate()
1196 if (Instruction *Op2I = dyn_cast<Instruction>(Op2)) in validate()
1205 if (DRS.Roots[Iter-1] == (Instruction*) Op2) { in validate()
1267 Instruction *D = &*J; in replace()
1341 for (Instruction *J : PossibleReds[i]) { in validateSelected()
1396 Users.push_back(cast<Instruction>(U)); in replaceSelected()
1449 bool LoopReroll::reroll(Instruction *IV, Loop *L, BasicBlock *Header, in reroll()