Lines Matching refs:Instruction

173     using SmallInstructionVector = SmallVector<Instruction *, 16>;
174 using SmallInstructionSet = SmallPtrSet<Instruction *, 16>;
175 using TinyInstructionVector = SmallVector<Instruction *, 1>;
178 DenseMap<Instruction *, int64_t> IVToIncMap;
188 SimpleLoopReduction(Instruction *P, Loop *L) : Instructions(1, P) { in SimpleLoopReduction()
197 Instruction *getPHI() const { in getPHI()
202 Instruction *getReducedValue() const { in getReducedValue()
207 Instruction *get(size_t i) const { in get()
212 Instruction *operator [] (size_t i) const { return get(i); } in operator []()
274 for (Instruction *J : PossibleReds[i]) { in restrictToScale()
285 bool isPairInSame(Instruction *J1, Instruction *J2) { in isPairInSame()
286 DenseMap<Instruction *, int>::iterator J1I = PossibleRedIdx.find(J1); in isPairInSame()
288 DenseMap<Instruction *, int>::iterator J2I = PossibleRedIdx.find(J2); in isPairInSame()
299 void recordPair(Instruction *J1, Instruction *J2, unsigned i) { in recordPair()
324 DenseMap<Instruction *, int> PossibleRedIdx;
325 DenseMap<Instruction *, int> PossibleRedIter;
356 Instruction *BaseInst;
366 DAGRootTracker(LoopReroll *Parent, Loop *L, Instruction *IV, in DAGRootTracker()
370 DenseMap<Instruction *, int64_t> &IncrMap, in DAGRootTracker()
388 using UsesTy = MapVector<Instruction *, BitVector>;
390 void findRootsRecursive(Instruction *IVU,
392 bool findRootsBase(Instruction *IVU, SmallInstructionSet SubsumedInsts);
393 bool collectPossibleRoots(Instruction *Base,
394 std::map<int64_t,Instruction*> &Roots);
401 DenseSet<Instruction *> &Users);
402 void collectInLoopUserSet(Instruction *Root,
405 DenseSet<Instruction *> &Users);
410 bool isBaseInst(Instruction *I);
411 bool isRootInst(Instruction *I);
412 bool instrDependsOn(Instruction *I,
429 Instruction *IV;
451 DenseMap<Instruction *, int64_t> &IVToIncMap;
457 bool isCompareUsedByBranch(Instruction *I) { in isCompareUsedByBranch()
464 bool isLoopControlIV(Loop *L, Instruction *IV);
468 bool reroll(Instruction *IV, Loop *L, BasicBlock *Header,
477 static bool hasUsesOutsideLoop(Instruction *I, Loop *L) { in hasUsesOutsideLoop()
479 if (!L->contains(cast<Instruction>(U))) in hasUsesOutsideLoop()
491 bool LoopReroll::isLoopControlIV(Loop *L, Instruction *IV) { in isLoopControlIV()
498 bool IsCompInst = isCompareUsedByBranch(cast<Instruction>(User)); in isLoopControlIV()
518 if (BO->getOpcode() == Instruction::Add) { in isLoopControlIV()
528 auto *UUser = cast<Instruction>(UU); in isLoopControlIV()
533 UUser = cast<Instruction>(*(UUser->user_begin())); in isLoopControlIV()
551 for (Instruction &IV : L->getHeader()->phis()) { in collectPossibleIVs()
587 Instruction *C = Instructions.front(); in add()
592 C = cast<Instruction>(*C->user_begin()); in add()
613 if (L->contains(cast<Instruction>(U))) in add()
614 if (cast<Instruction>(U) != Instructions.front()) in add()
656 Instruction *Root, const SmallInstructionSet &Exclude, in collectInLoopUserSet()
658 DenseSet<Instruction *> &Users) { in collectInLoopUserSet()
661 Instruction *I = Queue.pop_back_val(); in collectInLoopUserSet()
667 Instruction *User = cast<Instruction>(U.getUser()); in collectInLoopUserSet()
681 if (Instruction *Op = dyn_cast<Instruction>(U)) in collectInLoopUserSet()
695 DenseSet<Instruction *> &Users) { in collectInLoopUserSet()
696 for (Instruction *Root : Roots) in collectInLoopUserSet()
700 static bool isUnorderedLoadStore(Instruction *I) { in isUnorderedLoadStore()
714 if (Instruction *I = dyn_cast<Instruction>(IVU)) { in isSimpleArithmeticOp()
717 case Instruction::Add: in isSimpleArithmeticOp()
718 case Instruction::Sub: in isSimpleArithmeticOp()
719 case Instruction::Mul: in isSimpleArithmeticOp()
720 case Instruction::Shl: in isSimpleArithmeticOp()
721 case Instruction::AShr: in isSimpleArithmeticOp()
722 case Instruction::LShr: in isSimpleArithmeticOp()
723 case Instruction::GetElementPtr: in isSimpleArithmeticOp()
724 case Instruction::Trunc: in isSimpleArithmeticOp()
725 case Instruction::ZExt: in isSimpleArithmeticOp()
726 case Instruction::SExt: in isSimpleArithmeticOp()
733 static bool isLoopIncrement(User *U, Instruction *IV) { in isLoopIncrement()
736 if ((BO && BO->getOpcode() != Instruction::Add) || in isLoopIncrement()
749 collectPossibleRoots(Instruction *Base, std::map<int64_t,Instruction*> &Roots) { in collectPossibleRoots()
756 LoopIncs.push_back(cast<Instruction>(I)); in collectPossibleRoots()
762 if (BO->getOpcode() == Instruction::Add || in collectPossibleRoots()
763 BO->getOpcode() == Instruction::Or) in collectPossibleRoots()
771 if (Instruction *II = dyn_cast<Instruction>(I)) { in collectPossibleRoots()
786 Roots[V] = cast<Instruction>(I); in collectPossibleRoots()
825 findRootsRecursive(Instruction *I, SmallInstructionSet SubsumedInsts) { in findRootsRecursive()
837 Instruction *I = cast<Instruction>(V); in findRootsRecursive()
893 findRootsBase(Instruction *IVU, SmallInstructionSet SubsumedInsts) { in findRootsBase()
899 std::map<int64_t, Instruction*> V; in findRootsBase()
951 LoopIncs.push_back(cast<Instruction>(IVU)); in findRoots()
1005 DenseSet<Instruction*> VBase; in collectUsedInstructions()
1013 DenseSet<Instruction*> V; in collectUsedInstructions()
1043 DenseSet<Instruction*> V; in collectUsedInstructions()
1072 bool LoopReroll::DAGRootTracker::isBaseInst(Instruction *I) { in isBaseInst()
1080 bool LoopReroll::DAGRootTracker::isRootInst(Instruction *I) { in isRootInst()
1090 bool LoopReroll::DAGRootTracker::instrDependsOn(Instruction *I, in instrDependsOn()
1101 static bool isIgnorableInst(const Instruction *I) { in isIgnorableInst()
1153 for (Instruction *LoopControlIV : LoopControlIVs) { in validate()
1155 Instruction *IVUser = dyn_cast<Instruction>(U); in validate()
1159 Instruction *UUser = dyn_cast<Instruction>(UU); in validate()
1164 UUser = dyn_cast<Instruction>(*(UUser->user_begin())); in validate()
1169 Instruction *BI = dyn_cast<BranchInst>(*UUser->user_begin()); in validate()
1211 Instruction *BaseInst = BaseIt->first; in validate()
1212 Instruction *RootInst = RootIt->first; in validate()
1269 Instruction *I = LastRootIt->first; in validate()
1342 if (Instruction *Op2I = dyn_cast<Instruction>(Op2)) in validate()
1351 if (DRS.Roots[Iter-1] == (Instruction*) Op2) { in validate()
1422 for (Instruction &Inst : llvm::make_early_inc_range(llvm::reverse(*Header))) { in replace()
1469 Instruction *Inst = DRS.BaseInst; in replaceIV()
1493 for (Instruction *J : PossibleReds[i]) { in validateSelected()
1546 Users.push_back(cast<Instruction>(U)); in replaceSelected()
1549 for (Instruction *User : Users) in replaceSelected()
1598 bool LoopReroll::reroll(Instruction *IV, Loop *L, BasicBlock *Header, in reroll()
1659 for (Instruction *PossibleIV : PossibleIVs) in runOnLoop()