Lines Matching full:branch
1 //===-- SystemZLongBranch.cpp - Branch lengthening for SystemZ ------------===//
13 // to be in range with a longer form (branch relaxation). A simple
17 // quadratic in the number of blocks; relaxing branch N can make branch N-1
18 // go out of range, which in turn can make branch N-2 go out of range,
24 // in range (branch shortening). This too can be implemented as a function
27 // shortening is also quadratic in the worst case; shortening branch N
28 // can bring branch N-1 in range of the short form, which in turn can do
29 // the same for branch N-2, and so on. The main advantage of shortening
36 // which are relatively rare to begin with, and the long branch sequences
68 #define DEBUG_TYPE "systemz-long-branch"
95 // If this terminator is a relaxable branch, this points to the branch
97 MachineInstr *Branch;
105 // If Branch is nonnull, this is the number of the target block,
109 // If Branch is nonnull, this is the length of the longest relaxed form,
113 TerminatorInfo() : Branch(nullptr), Size(0), TargetBlock(0),
137 return "SystemZ Long Branch";
252 llvm_unreachable("Unrecognized branch instruction");
254 Terminator.Branch = &MI;
310 if (!Terminator.Branch)
348 // Split BRANCH ON COUNT MI into the addition given by AddOpcode followed
385 // Relax the branch described by Terminator.
387 MachineInstr *Branch = Terminator.Branch;
388 switch (Branch->getOpcode()) {
390 Branch->setDesc(TII->get(SystemZ::JG));
393 Branch->setDesc(TII->get(SystemZ::BRCL));
396 splitBranchOnCount(Branch, SystemZ::AHI);
399 splitBranchOnCount(Branch, SystemZ::AGHI);
402 splitCompareBranch(Branch, SystemZ::CR);
405 splitCompareBranch(Branch, SystemZ::CGR);
408 splitCompareBranch(Branch, SystemZ::CHI);
411 splitCompareBranch(Branch, SystemZ::CGHI);
414 splitCompareBranch(Branch, SystemZ::CLR);
417 splitCompareBranch(Branch, SystemZ::CLGR);
420 splitCompareBranch(Branch, SystemZ::CLFI);
423 splitCompareBranch(Branch, SystemZ::CLGFI);
426 llvm_unreachable("Unrecognized branch");
431 Terminator.Branch = nullptr;