Lines Matching full:branch

1 //===-- SystemZLongBranch.cpp - Branch lengthening for SystemZ ------------===//
12 // to be in range with a longer form (branch relaxation). A simple
16 // quadratic in the number of blocks; relaxing branch N can make branch N-1
17 // go out of range, which in turn can make branch N-2 go out of range,
23 // in range (branch shortening). This too can be implemented as a function
26 // shortening is also quadratic in the worst case; shortening branch N
27 // can bring branch N-1 in range of the short form, which in turn can do
28 // the same for branch N-2, and so on. The main advantage of shortening
35 // which are relatively rare to begin with, and the long branch sequences
73 #define DEBUG_TYPE "systemz-long-branch"
100 // If this terminator is a relaxable branch, this points to the branch
102 MachineInstr *Branch = nullptr; member
110 // If Branch is nonnull, this is the number of the target block,
114 // If Branch is nonnull, this is the length of the longest relaxed form,
176 INITIALIZE_PASS(SystemZLongBranch, DEBUG_TYPE, "SystemZ Long Branch", false,
272 llvm_unreachable("Unrecognized branch instruction"); in describeTerminator()
274 Terminator.Branch = &MI; in describeTerminator()
330 if (!Terminator.Branch || Terminator.ExtraRelaxSize == 0) in mustRelaxBranch()
368 // Split BRANCH ON COUNT MI into the addition given by AddOpcode followed
405 // Relax the branch described by Terminator.
407 MachineInstr *Branch = Terminator.Branch; in relaxBranch() local
408 switch (Branch->getOpcode()) { in relaxBranch()
410 Branch->setDesc(TII->get(SystemZ::JG)); in relaxBranch()
413 Branch->setDesc(TII->get(SystemZ::BRCL)); in relaxBranch()
416 splitBranchOnCount(Branch, SystemZ::AHI); in relaxBranch()
419 splitBranchOnCount(Branch, SystemZ::AGHI); in relaxBranch()
422 splitCompareBranch(Branch, SystemZ::CR); in relaxBranch()
425 splitCompareBranch(Branch, SystemZ::CGR); in relaxBranch()
428 splitCompareBranch(Branch, SystemZ::CHI); in relaxBranch()
431 splitCompareBranch(Branch, SystemZ::CGHI); in relaxBranch()
434 splitCompareBranch(Branch, SystemZ::CLR); in relaxBranch()
437 splitCompareBranch(Branch, SystemZ::CLGR); in relaxBranch()
440 splitCompareBranch(Branch, SystemZ::CLFI); in relaxBranch()
443 splitCompareBranch(Branch, SystemZ::CLGFI); in relaxBranch()
446 llvm_unreachable("Unrecognized branch"); in relaxBranch()
451 Terminator.Branch = nullptr; in relaxBranch()