Lines Matching refs:Instruction
192 using SmallInstructionVector = SmallVector<Instruction *, 16>;
193 using SmallInstructionSet = SmallPtrSet<Instruction *, 16>;
196 DenseMap<Instruction *, int64_t> IVToIncMap;
200 Instruction *LoopControlIV;
206 SimpleLoopReduction(Instruction *P, Loop *L) : Instructions(1, P) { in SimpleLoopReduction()
215 Instruction *getPHI() const { in getPHI()
220 Instruction *getReducedValue() const { in getReducedValue()
225 Instruction *get(size_t i) const { in get()
230 Instruction *operator [] (size_t i) const { return get(i); } in operator []()
292 for (Instruction *J : PossibleReds[i]) { in restrictToScale()
303 bool isPairInSame(Instruction *J1, Instruction *J2) { in isPairInSame()
304 DenseMap<Instruction *, int>::iterator J1I = PossibleRedIdx.find(J1); in isPairInSame()
306 DenseMap<Instruction *, int>::iterator J2I = PossibleRedIdx.find(J2); in isPairInSame()
317 void recordPair(Instruction *J1, Instruction *J2, unsigned i) { in recordPair()
342 DenseMap<Instruction *, int> PossibleRedIdx;
343 DenseMap<Instruction *, int> PossibleRedIter;
374 Instruction *BaseInst;
384 DAGRootTracker(LoopReroll *Parent, Loop *L, Instruction *IV, in DAGRootTracker()
388 DenseMap<Instruction *, int64_t> &IncrMap, in DAGRootTracker()
389 Instruction *LoopCtrlIV) in DAGRootTracker()
406 using UsesTy = MapVector<Instruction *, BitVector>;
408 void findRootsRecursive(Instruction *IVU,
410 bool findRootsBase(Instruction *IVU, SmallInstructionSet SubsumedInsts);
411 bool collectPossibleRoots(Instruction *Base,
412 std::map<int64_t,Instruction*> &Roots);
419 DenseSet<Instruction *> &Users);
420 void collectInLoopUserSet(Instruction *Root,
423 DenseSet<Instruction *> &Users);
428 bool isBaseInst(Instruction *I);
429 bool isRootInst(Instruction *I);
430 bool instrDependsOn(Instruction *I,
447 Instruction *IV;
469 DenseMap<Instruction *, int64_t> &IVToIncMap;
471 Instruction *LoopControlIV;
475 bool isCompareUsedByBranch(Instruction *I) { in isCompareUsedByBranch()
482 bool isLoopControlIV(Loop *L, Instruction *IV);
486 bool reroll(Instruction *IV, Loop *L, BasicBlock *Header,
506 static bool hasUsesOutsideLoop(Instruction *I, Loop *L) { in hasUsesOutsideLoop()
508 if (!L->contains(cast<Instruction>(U))) in hasUsesOutsideLoop()
520 bool LoopReroll::isLoopControlIV(Loop *L, Instruction *IV) { in isLoopControlIV()
527 bool IsCompInst = isCompareUsedByBranch(cast<Instruction>(User)); in isLoopControlIV()
547 if (BO->getOpcode() == Instruction::Add) { in isLoopControlIV()
557 auto *UUser = cast<Instruction>(UU); in isLoopControlIV()
562 UUser = cast<Instruction>(*(UUser->user_begin())); in isLoopControlIV()
621 Instruction *C = Instructions.front(); in add()
626 C = cast<Instruction>(*C->user_begin()); in add()
647 if (L->contains(cast<Instruction>(U))) in add()
648 if (cast<Instruction>(U) != Instructions.front()) in add()
690 Instruction *Root, const SmallInstructionSet &Exclude, in collectInLoopUserSet()
692 DenseSet<Instruction *> &Users) { in collectInLoopUserSet()
695 Instruction *I = Queue.pop_back_val(); in collectInLoopUserSet()
701 Instruction *User = cast<Instruction>(U.getUser()); in collectInLoopUserSet()
715 if (Instruction *Op = dyn_cast<Instruction>(U)) in collectInLoopUserSet()
729 DenseSet<Instruction *> &Users) { in collectInLoopUserSet()
730 for (Instruction *Root : Roots) in collectInLoopUserSet()
734 static bool isUnorderedLoadStore(Instruction *I) { in isUnorderedLoadStore()
748 if (Instruction *I = dyn_cast<Instruction>(IVU)) { in isSimpleArithmeticOp()
751 case Instruction::Add: in isSimpleArithmeticOp()
752 case Instruction::Sub: in isSimpleArithmeticOp()
753 case Instruction::Mul: in isSimpleArithmeticOp()
754 case Instruction::Shl: in isSimpleArithmeticOp()
755 case Instruction::AShr: in isSimpleArithmeticOp()
756 case Instruction::LShr: in isSimpleArithmeticOp()
757 case Instruction::GetElementPtr: in isSimpleArithmeticOp()
758 case Instruction::Trunc: in isSimpleArithmeticOp()
759 case Instruction::ZExt: in isSimpleArithmeticOp()
760 case Instruction::SExt: in isSimpleArithmeticOp()
767 static bool isLoopIncrement(User *U, Instruction *IV) { in isLoopIncrement()
770 if ((BO && BO->getOpcode() != Instruction::Add) || in isLoopIncrement()
783 collectPossibleRoots(Instruction *Base, std::map<int64_t,Instruction*> &Roots) { in collectPossibleRoots()
790 LoopIncs.push_back(cast<Instruction>(I)); in collectPossibleRoots()
796 if (BO->getOpcode() == Instruction::Add || in collectPossibleRoots()
797 BO->getOpcode() == Instruction::Or) in collectPossibleRoots()
805 if (Instruction *II = dyn_cast<Instruction>(I)) { in collectPossibleRoots()
820 Roots[V] = cast<Instruction>(I); in collectPossibleRoots()
859 findRootsRecursive(Instruction *I, SmallInstructionSet SubsumedInsts) { in findRootsRecursive()
871 Instruction *I = cast<Instruction>(V); in findRootsRecursive()
927 findRootsBase(Instruction *IVU, SmallInstructionSet SubsumedInsts) { in findRootsBase()
933 std::map<int64_t, Instruction*> V; in findRootsBase()
985 LoopIncs.push_back(cast<Instruction>(IVU)); in findRoots()
1039 DenseSet<Instruction*> VBase; in collectUsedInstructions()
1047 DenseSet<Instruction*> V; in collectUsedInstructions()
1077 DenseSet<Instruction*> V; in collectUsedInstructions()
1106 bool LoopReroll::DAGRootTracker::isBaseInst(Instruction *I) { in isBaseInst()
1114 bool LoopReroll::DAGRootTracker::isRootInst(Instruction *I) { in isRootInst()
1124 bool LoopReroll::DAGRootTracker::instrDependsOn(Instruction *I, in instrDependsOn()
1135 static bool isIgnorableInst(const Instruction *I) { in isIgnorableInst()
1189 Instruction *IVUser = dyn_cast<Instruction>(U); in validate()
1193 Instruction *UUser = dyn_cast<Instruction>(UU); in validate()
1198 UUser = dyn_cast<Instruction>(*(UUser->user_begin())); in validate()
1203 Instruction *BI = dyn_cast<BranchInst>(*UUser->user_begin()); in validate()
1244 Instruction *BaseInst = BaseIt->first; in validate()
1245 Instruction *RootInst = RootIt->first; in validate()
1302 Instruction *I = LastRootIt->first; in validate()
1374 if (Instruction *Op2I = dyn_cast<Instruction>(Op2)) in validate()
1383 if (DRS.Roots[Iter-1] == (Instruction*) Op2) { in validate()
1454 for (Instruction &Inst : llvm::make_early_inc_range(llvm::reverse(*Header))) { in replace()
1501 Instruction *Inst = DRS.BaseInst; in replaceIV()
1525 for (Instruction *J : PossibleReds[i]) { in validateSelected()
1578 Users.push_back(cast<Instruction>(U)); in replaceSelected()
1581 for (Instruction *User : Users) in replaceSelected()
1630 bool LoopReroll::reroll(Instruction *IV, Loop *L, BasicBlock *Header, in reroll()
1691 for (Instruction *PossibleIV : PossibleIVs) in runOnLoop()