LCOV - code coverage report
Current view: top level - lib/Target/AArch64 - AArch64ConditionalCompares.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 253 284 89.1 %
Date: 2017-09-14 15:23:50 Functions: 23 24 95.8 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- AArch64ConditionalCompares.cpp --- CCMP formation for AArch64 -----===//
       2             : //
       3             : //                     The LLVM Compiler Infrastructure
       4             : //
       5             : // This file is distributed under the University of Illinois Open Source
       6             : // License. See LICENSE.TXT for details.
       7             : //
       8             : //===----------------------------------------------------------------------===//
       9             : //
      10             : // This file implements the AArch64ConditionalCompares pass which reduces
      11             : // branching and code size by using the conditional compare instructions CCMP,
      12             : // CCMN, and FCMP.
      13             : //
      14             : // The CFG transformations for forming conditional compares are very similar to
      15             : // if-conversion, and this pass should run immediately before the early
      16             : // if-conversion pass.
      17             : //
      18             : //===----------------------------------------------------------------------===//
      19             : 
      20             : #include "AArch64.h"
      21             : #include "llvm/ADT/DepthFirstIterator.h"
      22             : #include "llvm/ADT/SetVector.h"
      23             : #include "llvm/ADT/SmallPtrSet.h"
      24             : #include "llvm/ADT/Statistic.h"
      25             : #include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
      26             : #include "llvm/CodeGen/MachineDominators.h"
      27             : #include "llvm/CodeGen/MachineFunction.h"
      28             : #include "llvm/CodeGen/MachineFunctionPass.h"
      29             : #include "llvm/CodeGen/MachineInstrBuilder.h"
      30             : #include "llvm/CodeGen/MachineLoopInfo.h"
      31             : #include "llvm/CodeGen/MachineRegisterInfo.h"
      32             : #include "llvm/CodeGen/MachineTraceMetrics.h"
      33             : #include "llvm/CodeGen/Passes.h"
      34             : #include "llvm/Support/CommandLine.h"
      35             : #include "llvm/Support/Debug.h"
      36             : #include "llvm/Support/raw_ostream.h"
      37             : #include "llvm/Target/TargetInstrInfo.h"
      38             : #include "llvm/Target/TargetRegisterInfo.h"
      39             : #include "llvm/Target/TargetSubtargetInfo.h"
      40             : 
      41             : using namespace llvm;
      42             : 
      43             : #define DEBUG_TYPE "aarch64-ccmp"
      44             : 
      45             : // Absolute maximum number of instructions allowed per speculated block.
      46             : // This bypasses all other heuristics, so it should be set fairly high.
      47       72306 : static cl::opt<unsigned> BlockInstrLimit(
      48      216918 :     "aarch64-ccmp-limit", cl::init(30), cl::Hidden,
      49      289224 :     cl::desc("Maximum number of instructions per speculated block."));
      50             : 
      51             : // Stress testing mode - disable heuristics.
      52       72306 : static cl::opt<bool> Stress("aarch64-stress-ccmp", cl::Hidden,
      53      144612 :                             cl::desc("Turn all knobs to 11"));
      54             : 
      55             : STATISTIC(NumConsidered, "Number of ccmps considered");
      56             : STATISTIC(NumPhiRejs, "Number of ccmps rejected (PHI)");
      57             : STATISTIC(NumPhysRejs, "Number of ccmps rejected (Physregs)");
      58             : STATISTIC(NumPhi2Rejs, "Number of ccmps rejected (PHI2)");
      59             : STATISTIC(NumHeadBranchRejs, "Number of ccmps rejected (Head branch)");
      60             : STATISTIC(NumCmpBranchRejs, "Number of ccmps rejected (CmpBB branch)");
      61             : STATISTIC(NumCmpTermRejs, "Number of ccmps rejected (CmpBB is cbz...)");
      62             : STATISTIC(NumImmRangeRejs, "Number of ccmps rejected (Imm out of range)");
      63             : STATISTIC(NumLiveDstRejs, "Number of ccmps rejected (Cmp dest live)");
      64             : STATISTIC(NumMultNZCVUses, "Number of ccmps rejected (NZCV used)");
      65             : STATISTIC(NumUnknNZCVDefs, "Number of ccmps rejected (NZCV def unknown)");
      66             : 
      67             : STATISTIC(NumSpeculateRejs, "Number of ccmps rejected (Can't speculate)");
      68             : 
      69             : STATISTIC(NumConverted, "Number of ccmp instructions created");
      70             : STATISTIC(NumCompBranches, "Number of cbz/cbnz branches converted");
      71             : 
      72             : //===----------------------------------------------------------------------===//
      73             : //                                 SSACCmpConv
      74             : //===----------------------------------------------------------------------===//
      75             : //
      76             : // The SSACCmpConv class performs ccmp-conversion on SSA form machine code
      77             : // after determining if it is possible. The class contains no heuristics;
      78             : // external code should be used to determine when ccmp-conversion is a good
      79             : // idea.
      80             : //
      81             : // CCmp-formation works on a CFG representing chained conditions, typically
      82             : // from C's short-circuit || and && operators:
      83             : //
      84             : //   From:         Head            To:         Head
      85             : //                 / |                         CmpBB
      86             : //                /  |                         / |
      87             : //               |  CmpBB                     /  |
      88             : //               |  / |                    Tail  |
      89             : //               | /  |                      |   |
      90             : //              Tail  |                      |   |
      91             : //                |   |                      |   |
      92             : //               ... ...                    ... ...
      93             : //
      94             : // The Head block is terminated by a br.cond instruction, and the CmpBB block
      95             : // contains compare + br.cond. Tail must be a successor of both.
      96             : //
      97             : // The cmp-conversion turns the compare instruction in CmpBB into a conditional
      98             : // compare, and merges CmpBB into Head, speculatively executing its
      99             : // instructions. The AArch64 conditional compare instructions have an immediate
     100             : // operand that specifies the NZCV flag values when the condition is false and
     101             : // the compare isn't executed. This makes it possible to chain compares with
     102             : // different condition codes.
     103             : //
     104             : // Example:
     105             : //
     106             : //    if (a == 5 || b == 17)
     107             : //      foo();
     108             : //
     109             : //    Head:
     110             : //       cmp  w0, #5
     111             : //       b.eq Tail
     112             : //    CmpBB:
     113             : //       cmp  w1, #17
     114             : //       b.eq Tail
     115             : //    ...
     116             : //    Tail:
     117             : //      bl _foo
     118             : //
     119             : //  Becomes:
     120             : //
     121             : //    Head:
     122             : //       cmp  w0, #5
     123             : //       ccmp w1, #17, 4, ne  ; 4 = nZcv
     124             : //       b.eq Tail
     125             : //    ...
     126             : //    Tail:
     127             : //      bl _foo
     128             : //
     129             : // The ccmp condition code is the one that would cause the Head terminator to
     130             : // branch to CmpBB.
     131             : //
     132             : // FIXME: It should also be possible to speculate a block on the critical edge
     133             : // between Head and Tail, just like if-converting a diamond.
     134             : //
     135             : // FIXME: Handle PHIs in Tail by turning them into selects (if-conversion).
     136             : 
     137             : namespace {
     138        5469 : class SSACCmpConv {
     139             :   MachineFunction *MF;
     140             :   const TargetInstrInfo *TII;
     141             :   const TargetRegisterInfo *TRI;
     142             :   MachineRegisterInfo *MRI;
     143             :   const MachineBranchProbabilityInfo *MBPI;
     144             : 
     145             : public:
     146             :   /// The first block containing a conditional branch, dominating everything
     147             :   /// else.
     148             :   MachineBasicBlock *Head;
     149             : 
     150             :   /// The block containing cmp+br.cond with a successor shared with Head.
     151             :   MachineBasicBlock *CmpBB;
     152             : 
     153             :   /// The common successor for Head and CmpBB.
     154             :   MachineBasicBlock *Tail;
     155             : 
     156             :   /// The compare instruction in CmpBB that can be converted to a ccmp.
     157             :   MachineInstr *CmpMI;
     158             : 
     159             : private:
     160             :   /// The branch condition in Head as determined by AnalyzeBranch.
     161             :   SmallVector<MachineOperand, 4> HeadCond;
     162             : 
     163             :   /// The condition code that makes Head branch to CmpBB.
     164             :   AArch64CC::CondCode HeadCmpBBCC;
     165             : 
     166             :   /// The branch condition in CmpBB.
     167             :   SmallVector<MachineOperand, 4> CmpBBCond;
     168             : 
     169             :   /// The condition code that makes CmpBB branch to Tail.
     170             :   AArch64CC::CondCode CmpBBTailCC;
     171             : 
     172             :   /// Check if the Tail PHIs are trivially convertible.
     173             :   bool trivialTailPHIs();
     174             : 
     175             :   /// Remove CmpBB from the Tail PHIs.
     176             :   void updateTailPHIs();
     177             : 
     178             :   /// Check if an operand defining DstReg is dead.
     179             :   bool isDeadDef(unsigned DstReg);
     180             : 
     181             :   /// Find the compare instruction in MBB that controls the conditional branch.
     182             :   /// Return NULL if a convertible instruction can't be found.
     183             :   MachineInstr *findConvertibleCompare(MachineBasicBlock *MBB);
     184             : 
     185             :   /// Return true if all non-terminator instructions in MBB can be safely
     186             :   /// speculated.
     187             :   bool canSpeculateInstrs(MachineBasicBlock *MBB, const MachineInstr *CmpMI);
     188             : 
     189             : public:
     190             :   /// runOnMachineFunction - Initialize per-function data structures.
     191             :   void runOnMachineFunction(MachineFunction &MF,
     192             :                             const MachineBranchProbabilityInfo *MBPI) {
     193       11003 :     this->MF = &MF;
     194       11003 :     this->MBPI = MBPI;
     195       11003 :     TII = MF.getSubtarget().getInstrInfo();
     196       11003 :     TRI = MF.getSubtarget().getRegisterInfo();
     197       11003 :     MRI = &MF.getRegInfo();
     198             :   }
     199             : 
     200             :   /// If the sub-CFG headed by MBB can be cmp-converted, initialize the
     201             :   /// internal state, and return true.
     202             :   bool canConvert(MachineBasicBlock *MBB);
     203             : 
     204             :   /// Cmo-convert the last block passed to canConvertCmp(), assuming
     205             :   /// it is possible. Add any erased blocks to RemovedBlocks.
     206             :   void convert(SmallVectorImpl<MachineBasicBlock *> &RemovedBlocks);
     207             : 
     208             :   /// Return the expected code size delta if the conversion into a
     209             :   /// conditional compare is performed.
     210             :   int expectedCodeSizeDelta() const;
     211             : };
     212             : } // end anonymous namespace
     213             : 
     214             : // Check that all PHIs in Tail are selecting the same value from Head and CmpBB.
     215             : // This means that no if-conversion is required when merging CmpBB into Head.
     216         111 : bool SSACCmpConv::trivialTailPHIs() {
     217         570 :   for (auto &I : *Tail) {
     218             :     if (!I.isPHI())
     219             :       break;
     220          17 :     unsigned HeadReg = 0, CmpBBReg = 0;
     221             :     // PHI operands come in (VReg, MBB) pairs.
     222         155 :     for (unsigned oi = 1, oe = I.getNumOperands(); oi != oe; oi += 2) {
     223         276 :       MachineBasicBlock *MBB = I.getOperand(oi + 1).getMBB();
     224         276 :       unsigned Reg = I.getOperand(oi).getReg();
     225         138 :       if (MBB == Head) {
     226             :         assert((!HeadReg || HeadReg == Reg) && "Inconsistent PHI operands");
     227          17 :         HeadReg = Reg;
     228             :       }
     229         138 :       if (MBB == CmpBB) {
     230             :         assert((!CmpBBReg || CmpBBReg == Reg) && "Inconsistent PHI operands");
     231          19 :         CmpBBReg = Reg;
     232             :       }
     233             :     }
     234          17 :     if (HeadReg != CmpBBReg)
     235           8 :       return false;
     236             :   }
     237         103 :   return true;
     238             : }
     239             : 
     240             : // Assuming that trivialTailPHIs() is true, update the Tail PHIs by simply
     241             : // removing the CmpBB operands. The Head operands will be identical.
     242          11 : void SSACCmpConv::updateTailPHIs() {
     243          54 :   for (auto &I : *Tail) {
     244             :     if (!I.isPHI())
     245             :       break;
     246             :     // I is a PHI. It can have multiple entries for CmpBB.
     247           0 :     for (unsigned oi = I.getNumOperands(); oi > 2; oi -= 2) {
     248             :       // PHI operands are (Reg, MBB) at (oi-2, oi-1).
     249           0 :       if (I.getOperand(oi - 1).getMBB() == CmpBB) {
     250           0 :         I.RemoveOperand(oi - 1);
     251           0 :         I.RemoveOperand(oi - 2);
     252             :       }
     253             :     }
     254             :   }
     255          11 : }
     256             : 
     257             : // This pass runs before the AArch64DeadRegisterDefinitions pass, so compares
     258             : // are still writing virtual registers without any uses.
     259          36 : bool SSACCmpConv::isDeadDef(unsigned DstReg) {
     260             :   // Writes to the zero register are dead.
     261          36 :   if (DstReg == AArch64::WZR || DstReg == AArch64::XZR)
     262             :     return true;
     263          35 :   if (!TargetRegisterInfo::isVirtualRegister(DstReg))
     264             :     return false;
     265             :   // A virtual register def without any uses will be marked dead later, and
     266             :   // eventually replaced by the zero register.
     267          70 :   return MRI->use_nodbg_empty(DstReg);
     268             : }
     269             : 
     270             : // Parse a condition code returned by AnalyzeBranch, and compute the CondCode
     271             : // corresponding to TBB.
     272             : // Return
     273             : static bool parseCond(ArrayRef<MachineOperand> Cond, AArch64CC::CondCode &CC) {
     274             :   // A normal br.cond simply has the condition code.
     275         187 :   if (Cond[0].getImm() != -1) {
     276             :     assert(Cond.size() == 1 && "Unknown Cond array format");
     277         141 :     CC = (AArch64CC::CondCode)(int)Cond[0].getImm();
     278             :     return true;
     279             :   }
     280             :   // For tbz and cbz instruction, the opcode is next.
     281          46 :   switch (Cond[1].getImm()) {
     282             :   default:
     283             :     // This includes tbz / tbnz branches which can't be converted to
     284             :     // ccmp + br.cond.
     285             :     return false;
     286          18 :   case AArch64::CBZW:
     287             :   case AArch64::CBZX:
     288             :     assert(Cond.size() == 3 && "Unknown Cond array format");
     289          18 :     CC = AArch64CC::EQ;
     290             :     return true;
     291          11 :   case AArch64::CBNZW:
     292             :   case AArch64::CBNZX:
     293             :     assert(Cond.size() == 3 && "Unknown Cond array format");
     294          11 :     CC = AArch64CC::NE;
     295             :     return true;
     296             :   }
     297             : }
     298             : 
     299          82 : MachineInstr *SSACCmpConv::findConvertibleCompare(MachineBasicBlock *MBB) {
     300          82 :   MachineBasicBlock::iterator I = MBB->getFirstTerminator();
     301         164 :   if (I == MBB->end())
     302             :     return nullptr;
     303             :   // The terminator must be controlled by the flags.
     304         164 :   if (!I->readsRegister(AArch64::NZCV)) {
     305          32 :     switch (I->getOpcode()) {
     306          16 :     case AArch64::CBZW:
     307             :     case AArch64::CBZX:
     308             :     case AArch64::CBNZW:
     309             :     case AArch64::CBNZX:
     310             :       // These can be converted into a ccmp against #0.
     311          16 :       return &*I;
     312             :     }
     313             :     ++NumCmpTermRejs;
     314             :     DEBUG(dbgs() << "Flags not used by terminator: " << *I);
     315             :     return nullptr;
     316             :   }
     317             : 
     318             :   // Now find the instruction controlling the terminator.
     319         132 :   for (MachineBasicBlock::iterator B = MBB->begin(); I != B;) {
     320          66 :     --I;
     321             :     assert(!I->isTerminator() && "Spurious terminator");
     322         132 :     switch (I->getOpcode()) {
     323             :     // cmp is an alias for subs with a dead destination register.
     324          31 :     case AArch64::SUBSWri:
     325             :     case AArch64::SUBSXri:
     326             :     // cmn is an alias for adds with a dead destination register.
     327             :     case AArch64::ADDSWri:
     328             :     case AArch64::ADDSXri:
     329             :       // Check that the immediate operand is within range, ccmp wants a uimm5.
     330             :       // Rd = SUBSri Rn, imm, shift
     331          61 :       if (I->getOperand(3).getImm() || !isUInt<5>(I->getOperand(2).getImm())) {
     332             :         DEBUG(dbgs() << "Immediate out of range for ccmp: " << *I);
     333             :         ++NumImmRangeRejs;
     334          66 :         return nullptr;
     335             :       }
     336             :       LLVM_FALLTHROUGH;
     337             :     case AArch64::SUBSWrr:
     338             :     case AArch64::SUBSXrr:
     339             :     case AArch64::ADDSWrr:
     340             :     case AArch64::ADDSXrr:
     341          36 :       if (isDeadDef(I->getOperand(0).getReg()))
     342          36 :         return &*I;
     343             :       DEBUG(dbgs() << "Can't convert compare with live destination: " << *I);
     344             :       ++NumLiveDstRejs;
     345             :       return nullptr;
     346             :     case AArch64::FCMPSrr:
     347             :     case AArch64::FCMPDrr:
     348             :     case AArch64::FCMPESrr:
     349             :     case AArch64::FCMPEDrr:
     350             :       return &*I;
     351             :     }
     352             : 
     353             :     // Check for flag reads and clobbers.
     354             :     MIOperands::PhysRegInfo PRI =
     355          32 :         MIOperands(*I).analyzePhysReg(AArch64::NZCV, TRI);
     356             : 
     357          16 :     if (PRI.Read) {
     358             :       // The ccmp doesn't produce exactly the same flags as the original
     359             :       // compare, so reject the transform if there are uses of the flags
     360             :       // besides the terminators.
     361             :       DEBUG(dbgs() << "Can't create ccmp with multiple uses: " << *I);
     362             :       ++NumMultNZCVUses;
     363             :       return nullptr;
     364             :     }
     365             : 
     366          16 :     if (PRI.Defined || PRI.Clobbered) {
     367             :       DEBUG(dbgs() << "Not convertible compare: " << *I);
     368             :       ++NumUnknNZCVDefs;
     369             :       return nullptr;
     370             :     }
     371             :   }
     372             :   DEBUG(dbgs() << "Flags not defined in BB#" << MBB->getNumber() << '\n');
     373             :   return nullptr;
     374             : }
     375             : 
     376             : /// Determine if all the instructions in MBB can safely
     377             : /// be speculated. The terminators are not considered.
     378             : ///
     379             : /// Only CmpMI is allowed to clobber the flags.
     380             : ///
     381          53 : bool SSACCmpConv::canSpeculateInstrs(MachineBasicBlock *MBB,
     382             :                                      const MachineInstr *CmpMI) {
     383             :   // Reject any live-in physregs. It's probably NZCV/EFLAGS, and very hard to
     384             :   // get right.
     385          53 :   if (!MBB->livein_empty()) {
     386             :     DEBUG(dbgs() << "BB#" << MBB->getNumber() << " has live-ins.\n");
     387             :     return false;
     388             :   }
     389             : 
     390          53 :   unsigned InstrCount = 0;
     391             : 
     392             :   // Check all instructions, except the terminators. It is assumed that
     393             :   // terminators never have side effects or define any used register values.
     394         350 :   for (auto &I : make_range(MBB->begin(), MBB->getFirstTerminator())) {
     395          80 :     if (I.isDebugValue())
     396           0 :       continue;
     397             : 
     398         160 :     if (++InstrCount > BlockInstrLimit && !Stress) {
     399             :       DEBUG(dbgs() << "BB#" << MBB->getNumber() << " has more than "
     400             :                    << BlockInstrLimit << " instructions.\n");
     401          22 :       return false;
     402             :     }
     403             : 
     404             :     // There shouldn't normally be any phis in a single-predecessor block.
     405          80 :     if (I.isPHI()) {
     406             :       DEBUG(dbgs() << "Can't hoist: " << I);
     407             :       return false;
     408             :     }
     409             : 
     410             :     // Don't speculate loads. Note that it may be possible and desirable to
     411             :     // speculate GOT or constant pool loads that are guaranteed not to trap,
     412             :     // but we don't support that for now.
     413          80 :     if (I.mayLoad()) {
     414             :       DEBUG(dbgs() << "Won't speculate load: " << I);
     415             :       return false;
     416             :     }
     417             : 
     418             :     // We never speculate stores, so an AA pointer isn't necessary.
     419          63 :     bool DontMoveAcrossStore = true;
     420          63 :     if (!I.isSafeToMove(nullptr, DontMoveAcrossStore)) {
     421             :       DEBUG(dbgs() << "Can't speculate: " << I);
     422             :       return false;
     423             :     }
     424             : 
     425             :     // Only CmpMI is allowed to clobber the flags.
     426         100 :     if (&I != CmpMI && I.modifiesRegister(AArch64::NZCV, TRI)) {
     427             :       DEBUG(dbgs() << "Clobbers flags: " << I);
     428             :       return false;
     429             :     }
     430             :   }
     431             :   return true;
     432             : }
     433             : 
     434             : /// Analyze the sub-cfg rooted in MBB, and return true if it is a potential
     435             : /// candidate for cmp-conversion. Fill out the internal state.
     436             : ///
     437       13118 : bool SSACCmpConv::canConvert(MachineBasicBlock *MBB) {
     438       13118 :   Head = MBB;
     439       13118 :   Tail = CmpBB = nullptr;
     440             : 
     441       26236 :   if (Head->succ_size() != 2)
     442             :     return false;
     443        2014 :   MachineBasicBlock *Succ0 = Head->succ_begin()[0];
     444        2014 :   MachineBasicBlock *Succ1 = Head->succ_begin()[1];
     445             : 
     446             :   // CmpBB can only have a single predecessor. Tail is allowed many.
     447        2014 :   if (Succ0->pred_size() != 1)
     448             :     std::swap(Succ0, Succ1);
     449             : 
     450             :   // Succ0 is our candidate for CmpBB.
     451        2934 :   if (Succ0->pred_size() != 1 || Succ0->succ_size() != 2)
     452             :     return false;
     453             : 
     454         199 :   CmpBB = Succ0;
     455         199 :   Tail = Succ1;
     456             : 
     457         199 :   if (!CmpBB->isSuccessor(Tail))
     458             :     return false;
     459             : 
     460             :   // The CFG topology checks out.
     461             :   DEBUG(dbgs() << "\nTriangle: BB#" << Head->getNumber() << " -> BB#"
     462             :                << CmpBB->getNumber() << " -> BB#" << Tail->getNumber() << '\n');
     463         111 :   ++NumConsidered;
     464             : 
     465             :   // Tail is allowed to have many predecessors, but we can't handle PHIs yet.
     466             :   //
     467             :   // FIXME: Real PHIs could be if-converted as long as the CmpBB values are
     468             :   // defined before The CmpBB cmp clobbers the flags. Alternatively, it should
     469             :   // always be safe to sink the ccmp down to immediately before the CmpBB
     470             :   // terminators.
     471         111 :   if (!trivialTailPHIs()) {
     472             :     DEBUG(dbgs() << "Can't handle phis in Tail.\n");
     473             :     ++NumPhiRejs;
     474             :     return false;
     475             :   }
     476             : 
     477         206 :   if (!Tail->livein_empty()) {
     478             :     DEBUG(dbgs() << "Can't handle live-in physregs in Tail.\n");
     479             :     ++NumPhysRejs;
     480             :     return false;
     481             :   }
     482             : 
     483             :   // CmpBB should never have PHIs since Head is its only predecessor.
     484             :   // FIXME: Clean them up if it happens.
     485         309 :   if (!CmpBB->empty() && CmpBB->front().isPHI()) {
     486             :     DEBUG(dbgs() << "Can't handle phis in CmpBB.\n");
     487             :     ++NumPhi2Rejs;
     488             :     return false;
     489             :   }
     490             : 
     491         206 :   if (!CmpBB->livein_empty()) {
     492             :     DEBUG(dbgs() << "Can't handle live-in physregs in CmpBB.\n");
     493             :     ++NumPhysRejs;
     494             :     return false;
     495             :   }
     496             : 
     497             :   // The branch we're looking to eliminate must be analyzable.
     498         206 :   HeadCond.clear();
     499         103 :   MachineBasicBlock *TBB = nullptr, *FBB = nullptr;
     500         103 :   if (TII->analyzeBranch(*Head, TBB, FBB, HeadCond)) {
     501             :     DEBUG(dbgs() << "Head branch not analyzable.\n");
     502             :     ++NumHeadBranchRejs;
     503             :     return false;
     504             :   }
     505             : 
     506             :   // This is weird, probably some sort of degenerate CFG, or an edge to a
     507             :   // landing pad.
     508         101 :   if (!TBB || HeadCond.empty()) {
     509             :     DEBUG(dbgs() << "AnalyzeBranch didn't find conditional branch in Head.\n");
     510             :     ++NumHeadBranchRejs;
     511             :     return false;
     512             :   }
     513             : 
     514         290 :   if (!parseCond(HeadCond, HeadCmpBBCC)) {
     515             :     DEBUG(dbgs() << "Unsupported branch type on Head\n");
     516             :     ++NumHeadBranchRejs;
     517             :     return false;
     518             :   }
     519             : 
     520             :   // Make sure the branch direction is right.
     521          88 :   if (TBB != CmpBB) {
     522             :     assert(TBB == Tail && "Unexpected TBB");
     523         176 :     HeadCmpBBCC = AArch64CC::getInvertedCondCode(HeadCmpBBCC);
     524             :   }
     525             : 
     526         176 :   CmpBBCond.clear();
     527          88 :   TBB = FBB = nullptr;
     528          88 :   if (TII->analyzeBranch(*CmpBB, TBB, FBB, CmpBBCond)) {
     529             :     DEBUG(dbgs() << "CmpBB branch not analyzable.\n");
     530             :     ++NumCmpBranchRejs;
     531             :     return false;
     532             :   }
     533             : 
     534          86 :   if (!TBB || CmpBBCond.empty()) {
     535             :     DEBUG(dbgs() << "AnalyzeBranch didn't find conditional branch in CmpBB.\n");
     536             :     ++NumCmpBranchRejs;
     537             :     return false;
     538             :   }
     539             : 
     540         254 :   if (!parseCond(CmpBBCond, CmpBBTailCC)) {
     541             :     DEBUG(dbgs() << "Unsupported branch type on CmpBB\n");
     542             :     ++NumCmpBranchRejs;
     543             :     return false;
     544             :   }
     545             : 
     546          82 :   if (TBB != Tail)
     547          52 :     CmpBBTailCC = AArch64CC::getInvertedCondCode(CmpBBTailCC);
     548             : 
     549             :   DEBUG(dbgs() << "Head->CmpBB on " << AArch64CC::getCondCodeName(HeadCmpBBCC)
     550             :                << ", CmpBB->Tail on " << AArch64CC::getCondCodeName(CmpBBTailCC)
     551             :                << '\n');
     552             : 
     553          82 :   CmpMI = findConvertibleCompare(CmpBB);
     554          82 :   if (!CmpMI)
     555             :     return false;
     556             : 
     557          53 :   if (!canSpeculateInstrs(CmpBB, CmpMI)) {
     558             :     ++NumSpeculateRejs;
     559             :     return false;
     560             :   }
     561          31 :   return true;
     562             : }
     563             : 
     564          11 : void SSACCmpConv::convert(SmallVectorImpl<MachineBasicBlock *> &RemovedBlocks) {
     565             :   DEBUG(dbgs() << "Merging BB#" << CmpBB->getNumber() << " into BB#"
     566             :                << Head->getNumber() << ":\n" << *CmpBB);
     567             : 
     568             :   // All CmpBB instructions are moved into Head, and CmpBB is deleted.
     569             :   // Update the CFG first.
     570          11 :   updateTailPHIs();
     571             : 
     572             :   // Save successor probabilties before removing CmpBB and Tail from their
     573             :   // parents.
     574          11 :   BranchProbability Head2CmpBB = MBPI->getEdgeProbability(Head, CmpBB);
     575          11 :   BranchProbability CmpBB2Tail = MBPI->getEdgeProbability(CmpBB, Tail);
     576             : 
     577          11 :   Head->removeSuccessor(CmpBB);
     578          11 :   CmpBB->removeSuccessor(Tail);
     579             : 
     580             :   // If Head and CmpBB had successor probabilties, udpate the probabilities to
     581             :   // reflect the ccmp-conversion.
     582          33 :   if (Head->hasSuccessorProbabilities() && CmpBB->hasSuccessorProbabilities()) {
     583             : 
     584             :     // Head is allowed two successors. We've removed CmpBB, so the remaining
     585             :     // successor is Tail. We need to increase the successor probability for
     586             :     // Tail to account for the CmpBB path we removed.
     587             :     //
     588             :     // Pr(Tail|Head) += Pr(CmpBB|Head) * Pr(Tail|CmpBB).
     589             :     assert(*Head->succ_begin() == Tail && "Head successor is not Tail");
     590          11 :     BranchProbability Head2Tail = MBPI->getEdgeProbability(Head, Tail);
     591          44 :     Head->setSuccProbability(Head->succ_begin(),
     592             :                              Head2Tail + Head2CmpBB * CmpBB2Tail);
     593             : 
     594             :     // We will transfer successors of CmpBB to Head in a moment without
     595             :     // normalizing the successor probabilities. Set the successor probabilites
     596             :     // before doing so.
     597             :     //
     598             :     // Pr(I|Head) = Pr(CmpBB|Head) * Pr(I|CmpBB).
     599          55 :     for (auto I = CmpBB->succ_begin(), E = CmpBB->succ_end(); I != E; ++I) {
     600          11 :       BranchProbability CmpBB2I = MBPI->getEdgeProbability(CmpBB, *I);
     601          22 :       CmpBB->setSuccProbability(I, Head2CmpBB * CmpBB2I);
     602             :     }
     603             :   }
     604             : 
     605          11 :   Head->transferSuccessorsAndUpdatePHIs(CmpBB);
     606          44 :   DebugLoc TermDL = Head->getFirstTerminator()->getDebugLoc();
     607          11 :   TII->removeBranch(*Head);
     608             : 
     609             :   // If the Head terminator was one of the cbz / tbz branches with built-in
     610             :   // compare, we need to insert an explicit compare instruction in its place.
     611          22 :   if (HeadCond[0].getImm() == -1) {
     612           3 :     ++NumCompBranches;
     613           3 :     unsigned Opc = 0;
     614           6 :     switch (HeadCond[1].getImm()) {
     615             :     case AArch64::CBZW:
     616             :     case AArch64::CBNZW:
     617             :       Opc = AArch64::SUBSWri;
     618             :       break;
     619           0 :     case AArch64::CBZX:
     620             :     case AArch64::CBNZX:
     621           0 :       Opc = AArch64::SUBSXri;
     622           0 :       break;
     623           0 :     default:
     624           0 :       llvm_unreachable("Cannot convert Head branch");
     625             :     }
     626           6 :     const MCInstrDesc &MCID = TII->get(Opc);
     627             :     // Create a dummy virtual register for the SUBS def.
     628             :     unsigned DestReg =
     629           3 :         MRI->createVirtualRegister(TII->getRegClass(MCID, 0, TRI, *MF));
     630             :     // Insert a SUBS Rn, #0 instruction instead of the cbz / cbnz.
     631           9 :     BuildMI(*Head, Head->end(), TermDL, MCID)
     632           3 :         .addReg(DestReg, RegState::Define | RegState::Dead)
     633           9 :         .add(HeadCond[2])
     634           3 :         .addImm(0)
     635           3 :         .addImm(0);
     636             :     // SUBS uses the GPR*sp register classes.
     637           9 :     MRI->constrainRegClass(HeadCond[2].getReg(),
     638           3 :                            TII->getRegClass(MCID, 1, TRI, *MF));
     639             :   }
     640             : 
     641          55 :   Head->splice(Head->end(), CmpBB, CmpBB->begin(), CmpBB->end());
     642             : 
     643             :   // Now replace CmpMI with a ccmp instruction that also considers the incoming
     644             :   // flags.
     645          11 :   unsigned Opc = 0;
     646          11 :   unsigned FirstOp = 1;   // First CmpMI operand to copy.
     647          11 :   bool isZBranch = false; // CmpMI is a cbz/cbnz instruction.
     648          22 :   switch (CmpMI->getOpcode()) {
     649           0 :   default:
     650           0 :     llvm_unreachable("Unknown compare opcode");
     651             :   case AArch64::SUBSWri:    Opc = AArch64::CCMPWi; break;
     652           1 :   case AArch64::SUBSWrr:    Opc = AArch64::CCMPWr; break;
     653           0 :   case AArch64::SUBSXri:    Opc = AArch64::CCMPXi; break;
     654           1 :   case AArch64::SUBSXrr:    Opc = AArch64::CCMPXr; break;
     655           0 :   case AArch64::ADDSWri:    Opc = AArch64::CCMNWi; break;
     656           0 :   case AArch64::ADDSWrr:    Opc = AArch64::CCMNWr; break;
     657           0 :   case AArch64::ADDSXri:    Opc = AArch64::CCMNXi; break;
     658           0 :   case AArch64::ADDSXrr:    Opc = AArch64::CCMNXr; break;
     659           1 :   case AArch64::FCMPSrr:    Opc = AArch64::FCCMPSrr; FirstOp = 0; break;
     660           0 :   case AArch64::FCMPDrr:    Opc = AArch64::FCCMPDrr; FirstOp = 0; break;
     661           0 :   case AArch64::FCMPESrr:   Opc = AArch64::FCCMPESrr; FirstOp = 0; break;
     662           0 :   case AArch64::FCMPEDrr:   Opc = AArch64::FCCMPEDrr; FirstOp = 0; break;
     663           2 :   case AArch64::CBZW:
     664             :   case AArch64::CBNZW:
     665           2 :     Opc = AArch64::CCMPWi;
     666           2 :     FirstOp = 0;
     667           2 :     isZBranch = true;
     668           2 :     break;
     669           1 :   case AArch64::CBZX:
     670             :   case AArch64::CBNZX:
     671           1 :     Opc = AArch64::CCMPXi;
     672           1 :     FirstOp = 0;
     673           1 :     isZBranch = true;
     674           1 :     break;
     675             :   }
     676             : 
     677             :   // The ccmp instruction should set the flags according to the comparison when
     678             :   // Head would have branched to CmpBB.
     679             :   // The NZCV immediate operand should provide flags for the case where Head
     680             :   // would have branched to Tail. These flags should cause the new Head
     681             :   // terminator to branch to tail.
     682          11 :   unsigned NZCV = AArch64CC::getNZCVToSatisfyCondCode(CmpBBTailCC);
     683          22 :   const MCInstrDesc &MCID = TII->get(Opc);
     684          33 :   MRI->constrainRegClass(CmpMI->getOperand(FirstOp).getReg(),
     685          11 :                          TII->getRegClass(MCID, 0, TRI, *MF));
     686          33 :   if (CmpMI->getOperand(FirstOp + 1).isReg())
     687           9 :     MRI->constrainRegClass(CmpMI->getOperand(FirstOp + 1).getReg(),
     688           3 :                            TII->getRegClass(MCID, 1, TRI, *MF));
     689          33 :   MachineInstrBuilder MIB = BuildMI(*Head, CmpMI, CmpMI->getDebugLoc(), MCID)
     690          33 :                                 .add(CmpMI->getOperand(FirstOp)); // Register Rn
     691          11 :   if (isZBranch)
     692             :     MIB.addImm(0); // cbz/cbnz Rn -> ccmp Rn, #0
     693             :   else
     694          16 :     MIB.add(CmpMI->getOperand(FirstOp + 1)); // Register Rm / Immediate
     695          33 :   MIB.addImm(NZCV).addImm(HeadCmpBBCC);
     696             : 
     697             :   // If CmpMI was a terminator, we need a new conditional branch to replace it.
     698             :   // This now becomes a Head terminator.
     699          11 :   if (isZBranch) {
     700           8 :     bool isNZ = CmpMI->getOpcode() == AArch64::CBNZW ||
     701           5 :                 CmpMI->getOpcode() == AArch64::CBNZX;
     702          12 :     BuildMI(*Head, CmpMI, CmpMI->getDebugLoc(), TII->get(AArch64::Bcc))
     703           6 :         .addImm(isNZ ? AArch64CC::NE : AArch64CC::EQ)
     704           9 :         .add(CmpMI->getOperand(1)); // Branch target.
     705             :   }
     706          11 :   CmpMI->eraseFromParent();
     707          11 :   Head->updateTerminator();
     708             : 
     709          11 :   RemovedBlocks.push_back(CmpBB);
     710          11 :   CmpBB->eraseFromParent();
     711             :   DEBUG(dbgs() << "Result:\n" << *Head);
     712          11 :   ++NumConverted;
     713          11 : }
     714             : 
     715             : int SSACCmpConv::expectedCodeSizeDelta() const {
     716           0 :   int delta = 0;
     717             :   // If the Head terminator was one of the cbz / tbz branches with built-in
     718             :   // compare, we need to insert an explicit compare instruction in its place
     719             :   // plus a branch instruction.
     720           0 :   if (HeadCond[0].getImm() == -1) {
     721           0 :     switch (HeadCond[1].getImm()) {
     722             :     case AArch64::CBZW:
     723             :     case AArch64::CBNZW:
     724             :     case AArch64::CBZX:
     725             :     case AArch64::CBNZX:
     726             :       // Therefore delta += 1
     727             :       delta = 1;
     728             :       break;
     729           0 :     default:
     730           0 :       llvm_unreachable("Cannot convert Head branch");
     731             :     }
     732             :   }
     733             :   // If the Cmp terminator was one of the cbz / tbz branches with
     734             :   // built-in compare, it will be turned into a compare instruction
     735             :   // into Head, but we do not save any instruction.
     736             :   // Otherwise, we save the branch instruction.
     737           0 :   switch (CmpMI->getOpcode()) {
     738           0 :   default:
     739           0 :     --delta;
     740             :     break;
     741             :   case AArch64::CBZW:
     742             :   case AArch64::CBNZW:
     743             :   case AArch64::CBZX:
     744             :   case AArch64::CBNZX:
     745             :     break;
     746             :   }
     747             :   return delta;
     748             : }
     749             : 
     750             : //===----------------------------------------------------------------------===//
     751             : //                       AArch64ConditionalCompares Pass
     752             : //===----------------------------------------------------------------------===//
     753             : 
     754             : namespace {
     755         908 : class AArch64ConditionalCompares : public MachineFunctionPass {
     756             :   const MachineBranchProbabilityInfo *MBPI;
     757             :   const TargetInstrInfo *TII;
     758             :   const TargetRegisterInfo *TRI;
     759             :   MCSchedModel SchedModel;
     760             :   // Does the proceeded function has Oz attribute.
     761             :   bool MinSize;
     762             :   MachineRegisterInfo *MRI;
     763             :   MachineDominatorTree *DomTree;
     764             :   MachineLoopInfo *Loops;
     765             :   MachineTraceMetrics *Traces;
     766             :   MachineTraceMetrics::Ensemble *MinInstr;
     767             :   SSACCmpConv CmpConv;
     768             : 
     769             : public:
     770             :   static char ID;
     771        1830 :   AArch64ConditionalCompares() : MachineFunctionPass(ID) {
     772         915 :     initializeAArch64ConditionalComparesPass(*PassRegistry::getPassRegistry());
     773         915 :   }
     774             :   void getAnalysisUsage(AnalysisUsage &AU) const override;
     775             :   bool runOnMachineFunction(MachineFunction &MF) override;
     776         914 :   StringRef getPassName() const override {
     777         914 :     return "AArch64 Conditional Compares";
     778             :   }
     779             : 
     780             : private:
     781             :   bool tryConvert(MachineBasicBlock *);
     782             :   void updateDomTree(ArrayRef<MachineBasicBlock *> Removed);
     783             :   void updateLoops(ArrayRef<MachineBasicBlock *> Removed);
     784             :   void invalidateTraces();
     785             :   bool shouldConvert();
     786             : };
     787             : } // end anonymous namespace
     788             : 
     789             : char AArch64ConditionalCompares::ID = 0;
     790             : 
     791       53045 : INITIALIZE_PASS_BEGIN(AArch64ConditionalCompares, "aarch64-ccmp",
     792             :                       "AArch64 CCMP Pass", false, false)
     793       53045 : INITIALIZE_PASS_DEPENDENCY(MachineBranchProbabilityInfo)
     794       53045 : INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree)
     795       53045 : INITIALIZE_PASS_DEPENDENCY(MachineTraceMetrics)
     796      315298 : INITIALIZE_PASS_END(AArch64ConditionalCompares, "aarch64-ccmp",
     797             :                     "AArch64 CCMP Pass", false, false)
     798             : 
     799         914 : FunctionPass *llvm::createAArch64ConditionalCompares() {
     800         914 :   return new AArch64ConditionalCompares();
     801             : }
     802             : 
     803         908 : void AArch64ConditionalCompares::getAnalysisUsage(AnalysisUsage &AU) const {
     804         908 :   AU.addRequired<MachineBranchProbabilityInfo>();
     805         908 :   AU.addRequired<MachineDominatorTree>();
     806         908 :   AU.addPreserved<MachineDominatorTree>();
     807         908 :   AU.addRequired<MachineLoopInfo>();
     808         908 :   AU.addPreserved<MachineLoopInfo>();
     809         908 :   AU.addRequired<MachineTraceMetrics>();
     810         908 :   AU.addPreserved<MachineTraceMetrics>();
     811         908 :   MachineFunctionPass::getAnalysisUsage(AU);
     812         908 : }
     813             : 
     814             : /// Update the dominator tree after if-conversion erased some blocks.
     815          11 : void AArch64ConditionalCompares::updateDomTree(
     816             :     ArrayRef<MachineBasicBlock *> Removed) {
     817             :   // convert() removes CmpBB which was previously dominated by Head.
     818             :   // CmpBB children should be transferred to Head.
     819          11 :   MachineDomTreeNode *HeadNode = DomTree->getNode(CmpConv.Head);
     820          33 :   for (MachineBasicBlock *RemovedMBB : Removed) {
     821          11 :     MachineDomTreeNode *Node = DomTree->getNode(RemovedMBB);
     822             :     assert(Node != HeadNode && "Cannot erase the head node");
     823             :     assert(Node->getIDom() == HeadNode && "CmpBB should be dominated by Head");
     824          16 :     while (Node->getNumChildren())
     825          10 :       DomTree->changeImmediateDominator(Node->getChildren().back(), HeadNode);
     826          22 :     DomTree->eraseNode(RemovedMBB);
     827             :   }
     828          11 : }
     829             : 
     830             : /// Update LoopInfo after if-conversion.
     831             : void
     832          11 : AArch64ConditionalCompares::updateLoops(ArrayRef<MachineBasicBlock *> Removed) {
     833          11 :   if (!Loops)
     834             :     return;
     835          33 :   for (MachineBasicBlock *RemovedMBB : Removed)
     836          22 :     Loops->removeBlock(RemovedMBB);
     837             : }
     838             : 
     839             : /// Invalidate MachineTraceMetrics before if-conversion.
     840          11 : void AArch64ConditionalCompares::invalidateTraces() {
     841          11 :   Traces->invalidate(CmpConv.Head);
     842          11 :   Traces->invalidate(CmpConv.CmpBB);
     843          11 : }
     844             : 
     845             : /// Apply cost model and heuristics to the if-conversion in IfConv.
     846             : /// Return true if the conversion is a good idea.
     847             : ///
     848          31 : bool AArch64ConditionalCompares::shouldConvert() {
     849             :   // Stress testing mode disables all cost considerations.
     850          31 :   if (Stress)
     851             :     return true;
     852          21 :   if (!MinInstr)
     853          15 :     MinInstr = Traces->getEnsemble(MachineTraceMetrics::TS_MinInstrCount);
     854             : 
     855             :   // Head dominates CmpBB, so it is always included in its trace.
     856          21 :   MachineTraceMetrics::Trace Trace = MinInstr->getTrace(CmpConv.CmpBB);
     857             : 
     858             :   // If code size is the main concern
     859          21 :   if (MinSize) {
     860           0 :     int CodeSizeDelta = CmpConv.expectedCodeSizeDelta();
     861             :     DEBUG(dbgs() << "Code size delta:  " << CodeSizeDelta << '\n');
     862             :     // If we are minimizing the code size, do the conversion whatever
     863             :     // the cost is.
     864           0 :     if (CodeSizeDelta < 0)
     865             :       return true;
     866           0 :     if (CodeSizeDelta > 0) {
     867             :       DEBUG(dbgs() << "Code size is increasing, give up on this one.\n");
     868             :       return false;
     869             :     }
     870             :     // CodeSizeDelta == 0, continue with the regular heuristics
     871             :   }
     872             : 
     873             :   // Heuristic: The compare conversion delays the execution of the branch
     874             :   // instruction because we must wait for the inputs to the second compare as
     875             :   // well. The branch has no dependent instructions, but delaying it increases
     876             :   // the cost of a misprediction.
     877             :   //
     878             :   // Set a limit on the delay we will accept.
     879          21 :   unsigned DelayLimit = SchedModel.MispredictPenalty * 3 / 4;
     880             : 
     881             :   // Instruction depths can be computed for all trace instructions above CmpBB.
     882             :   unsigned HeadDepth =
     883          63 :       Trace.getInstrCycles(*CmpConv.Head->getFirstTerminator()).Depth;
     884             :   unsigned CmpBBDepth =
     885          63 :       Trace.getInstrCycles(*CmpConv.CmpBB->getFirstTerminator()).Depth;
     886             :   DEBUG(dbgs() << "Head depth:  " << HeadDepth
     887             :                << "\nCmpBB depth: " << CmpBBDepth << '\n');
     888          21 :   if (CmpBBDepth > HeadDepth + DelayLimit) {
     889             :     DEBUG(dbgs() << "Branch delay would be larger than " << DelayLimit
     890             :                  << " cycles.\n");
     891             :     return false;
     892             :   }
     893             : 
     894             :   // Check the resource depth at the bottom of CmpBB - these instructions will
     895             :   // be speculated.
     896          19 :   unsigned ResDepth = Trace.getResourceDepth(true);
     897             :   DEBUG(dbgs() << "Resources:   " << ResDepth << '\n');
     898             : 
     899             :   // Heuristic: The speculatively executed instructions must all be able to
     900             :   // merge into the Head block. The Head critical path should dominate the
     901             :   // resource cost of the speculated instructions.
     902          19 :   if (ResDepth > HeadDepth) {
     903             :     DEBUG(dbgs() << "Too many instructions to speculate.\n");
     904             :     return false;
     905             :   }
     906           1 :   return true;
     907             : }
     908             : 
     909       13107 : bool AArch64ConditionalCompares::tryConvert(MachineBasicBlock *MBB) {
     910       13107 :   bool Changed = false;
     911       13129 :   while (CmpConv.canConvert(MBB) && shouldConvert()) {
     912          11 :     invalidateTraces();
     913          22 :     SmallVector<MachineBasicBlock *, 4> RemovedBlocks;
     914          11 :     CmpConv.convert(RemovedBlocks);
     915          11 :     Changed = true;
     916          11 :     updateDomTree(RemovedBlocks);
     917          11 :     updateLoops(RemovedBlocks);
     918             :   }
     919       13107 :   return Changed;
     920             : }
     921             : 
     922       11004 : bool AArch64ConditionalCompares::runOnMachineFunction(MachineFunction &MF) {
     923             :   DEBUG(dbgs() << "********** AArch64 Conditional Compares **********\n"
     924             :                << "********** Function: " << MF.getName() << '\n');
     925       11004 :   if (skipFunction(*MF.getFunction()))
     926             :     return false;
     927             : 
     928       11003 :   TII = MF.getSubtarget().getInstrInfo();
     929       11003 :   TRI = MF.getSubtarget().getRegisterInfo();
     930       11003 :   SchedModel = MF.getSubtarget().getSchedModel();
     931       11003 :   MRI = &MF.getRegInfo();
     932       11003 :   DomTree = &getAnalysis<MachineDominatorTree>();
     933       11003 :   Loops = getAnalysisIfAvailable<MachineLoopInfo>();
     934       11003 :   MBPI = &getAnalysis<MachineBranchProbabilityInfo>();
     935       11003 :   Traces = &getAnalysis<MachineTraceMetrics>();
     936       11003 :   MinInstr = nullptr;
     937       22006 :   MinSize = MF.getFunction()->optForMinSize();
     938             : 
     939       11003 :   bool Changed = false;
     940       22006 :   CmpConv.runOnMachineFunction(MF, MBPI);
     941             : 
     942             :   // Visit blocks in dominator tree pre-order. The pre-order enables multiple
     943             :   // cmp-conversions from the same head block.
     944             :   // Note that updateDomTree() modifies the children of the DomTree node
     945             :   // currently being visited. The df_iterator supports that; it doesn't look at
     946             :   // child_begin() / child_end() until after a node has been visited.
     947       81229 :   for (auto *I : depth_first(DomTree))
     948       13107 :     if (tryConvert(I->getBlock()))
     949          10 :       Changed = true;
     950             : 
     951       11003 :   return Changed;
     952      216918 : }

Generated by: LCOV version 1.13