Home | History | Annotate | Download | only in AArch64

Lines Matching defs:Chain

107 class Chain;
132 bool colorChainSet(std::vector<Chain*> GV, MachineBasicBlock &MBB,
134 bool colorChain(Chain *G, Color C, MachineBasicBlock &MBB);
135 int scavengeRegister(Chain *G, Color C, MachineBasicBlock &MBB);
137 std::map<unsigned, Chain*> &Active,
138 std::set<std::unique_ptr<Chain>> &AllChains);
140 std::map<unsigned, Chain*> &RegChains);
142 Chain *getAndEraseNext(Color PreferredColor, std::vector<Chain*> &L);
146 /// A Chain is a sequence of instructions that are linked together by
154 /// do not belong to the chain. These other instructions must not use
155 /// the "chain" register at any point.
157 /// We currently only support chains where the "chain" operand is killed
158 /// at each link in the chain for simplicity.
159 /// A chain has three important instructions - Start, Last and Kill.
160 /// * The start instruction is the first instruction in the chain.
161 /// * Last is the final instruction in the chain.
171 class Chain {
178 /// All instructions in the chain.
184 /// The "color" of LastInst. This will be the preferred chain color,
189 Chain(MachineInstr *MI, unsigned Idx, Color C)
196 /// Add a new instruction into the chain. The instruction's dest operand
203 "Chain: broken invariant. A Chain can only be killed after its last "
209 /// Return true if MI is a member of the chain.
212 /// Return the number of instructions in the chain.
217 /// Inform the chain that its last active register (the dest register of
224 "Chain: broken invariant. A Chain can only be killed after its last "
228 /// Return the first instruction in the chain.
230 /// Return the last instruction in the chain.
235 /// of the chain. This is the maximum of KillInst (if set) and LastInst.
243 /// Return the preferred color of this chain.
250 /// Return true if this chain (StartInst..KillInst) overlaps with Other.
251 bool rangeOverlapsWith(const Chain &Other) const {
259 /// Return true if this chain starts before Other.
260 bool startsBefore(Chain *Other) {
269 /// Return a simple string representation of the chain.
319 // "link" register between each inst in the chain.
320 std::map<unsigned, Chain*> ActiveChains;
321 std::set<std::unique_ptr<Chain>> AllChains;
335 EquivalenceClasses<Chain*> EC;
349 std::vector<std::vector<Chain*> > V;
351 std::vector<Chain*> Cs(EC.member_begin(I), EC.member_end());
359 [](const std::vector<Chain*> &A,
360 const std::vector<Chain*> &B) {
383 Chain *AArch64A57FPLoadBalancing::getAndEraseNext(Color PreferredColor,
384 std::vector<Chain*> &L) {
391 // but if we can't find a chain of the maximum length with the preferred color,
393 // returning a chain that must be recolored.
401 Chain *Ch = *--I;
407 Chain *Ch = *I;
414 Chain *Ch = L.front();
419 bool AArch64A57FPLoadBalancing::colorChainSet(std::vector<Chain*> GV,
432 std::sort(GV.begin(), GV.end(), [](const Chain *G1, const Chain *G2) {
439 while (Chain *G = getAndEraseNext(PreferredColor, GV)) {
443 // But if we really don't care, use the chain's preferred color.
467 int AArch64A57FPLoadBalancing::scavengeRegister(Chain *G, Color C,
474 // of the chain?
502 bool AArch64A57FPLoadBalancing::colorChain(Chain *G, Color C,
577 std::map<unsigned, Chain*> &ActiveChains,
578 std::set<std::unique_ptr<Chain>> &AllChains) {
588 // Create a new chain. Multiplies don't require forwarding so can go on any
592 DEBUG(dbgs() << "New chain started for register "
595 auto G = llvm::make_unique<Chain>(MI, Idx, getColor(DestReg));
612 DEBUG(dbgs() << "Chain found for accumulator register "
615 // For simplicity we only chain together sequences of MULs/MLAs where the
621 // Add to chain.
622 DEBUG(dbgs() << "Instruction was successfully added to chain.\n");
632 DEBUG(dbgs() << "Cannot add to chain because accumulator operand wasn't "
637 DEBUG(dbgs() << "Creating new chain for dest register "
639 auto G = llvm::make_unique<Chain>(MI, Idx, getColor(DestReg));
645 // Non-MUL or MLA instruction. Invalidate any chain in the uses or defs
657 std::map<unsigned, Chain*> &ActiveChains) {
659 // determine if a chain should be ended and remove from ActiveChains.
664 // If this is a KILL of a current chain, record it.
666 DEBUG(dbgs() << "Kill seen for chain " << TRI->getName(MO.getReg())
677 DEBUG(dbgs() << "Kill (regmask) seen for chain "