Lines Matching full:branch
11 // (2) fuses compares and branches into COMPARE AND BRANCH instructions
38 STATISTIC(BranchOnCounts, "Number of branch-on-count instructions");
41 STATISTIC(FusedComparisons, "Number of fused compare-and-branch instructions");
181 // of -1 and if CCUsers is a single branch on nonzero, eliminate the addition
182 // and convert the branch to a BRCT(G) or BRCTH. Return true on success.
203 MachineInstr *Branch = CCUsers[0];
204 if (Branch->getOpcode() != SystemZ::BRC ||
205 Branch->getOperand(0).getImm() != SystemZ::CCMASK_ICMP ||
206 Branch->getOperand(1).getImm() != SystemZ::CCMASK_CMP_NE)
211 // Compare and Branch.
213 MachineBasicBlock::iterator MBBI = Compare, MBBE = Branch;
218 // The transformation is OK. Rebuild Branch as a BRCT(G) or BRCTH.
219 MachineOperand Target(Branch->getOperand(2));
220 while (Branch->getNumOperands())
221 Branch->removeOperand(0);
222 Branch->setDesc(TII->get(BRCT));
223 MachineInstrBuilder MIB(*Branch->getParent()->getParent(), Branch);
226 // branch displacement overflows. BRCTH has a 32-bit displacement, so
236 // the load and convert the branch to a load-and-trap. Return true on success.
247 MachineInstr *Branch = CCUsers[0];
248 if (Branch->getOpcode() != SystemZ::CondTrap ||
249 Branch->getOperand(0).getImm() != SystemZ::CCMASK_ICMP ||
250 Branch->getOperand(1).getImm() != SystemZ::CCMASK_CMP_EQ)
255 // Compare and Branch.
257 MachineBasicBlock::iterator MBBI = Compare, MBBE = Branch;
262 // The transformation is OK. Rebuild Branch as a load-and-trap.
263 while (Branch->getNumOperands())
264 Branch->removeOperand(0);
265 Branch->setDesc(TII->get(LATOpcode));
266 MachineInstrBuilder(*Branch->getParent()->getParent(), Branch)
518 // Try to remove both MI and Compare by converting a branch to BRCT(G).
576 // Try to fuse comparison instruction Compare into a later branch.
580 // See whether we have a single branch with which to fuse.
583 MachineInstr *Branch = CCUsers[0];
585 switch (Branch->getOpcode()) {
608 // Make sure that the operands are available at the branch.
615 MachineBasicBlock::iterator MBBI = Compare, MBBE = Branch;
621 // Read the branch mask, target (if applicable), regmask (if applicable).
636 Branch->removeOperand(CCUse);
639 Branch->removeOperand(3);
640 // Remove target (branch or sibcall).
643 Branch->removeOperand(2);
644 Branch->removeOperand(1);
645 Branch->removeOperand(0);
647 // Rebuild Branch as a fused compare and branch.
653 Branch->setDesc(TII->get(FusedOpcode));
654 MachineInstrBuilder MIB(*Branch->getParent()->getParent(), Branch);
661 // to a non-fused branch because of a long displacement. Conditional