LCOV - code coverage report
Current view: top level - lib/CodeGen - StackSlotColoring.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 175 176 99.4 %
Date: 2018-06-17 00:07:59 Functions: 16 16 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- StackSlotColoring.cpp - Stack slot coloring pass. ------------------===//
       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 stack slot coloring pass.
      11             : //
      12             : //===----------------------------------------------------------------------===//
      13             : 
      14             : #include "llvm/ADT/BitVector.h"
      15             : #include "llvm/ADT/SmallVector.h"
      16             : #include "llvm/ADT/Statistic.h"
      17             : #include "llvm/CodeGen/LiveInterval.h"
      18             : #include "llvm/CodeGen/LiveIntervals.h"
      19             : #include "llvm/CodeGen/LiveStacks.h"
      20             : #include "llvm/CodeGen/MachineBasicBlock.h"
      21             : #include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
      22             : #include "llvm/CodeGen/MachineFrameInfo.h"
      23             : #include "llvm/CodeGen/MachineFunction.h"
      24             : #include "llvm/CodeGen/MachineFunctionPass.h"
      25             : #include "llvm/CodeGen/MachineInstr.h"
      26             : #include "llvm/CodeGen/MachineMemOperand.h"
      27             : #include "llvm/CodeGen/MachineOperand.h"
      28             : #include "llvm/CodeGen/Passes.h"
      29             : #include "llvm/CodeGen/PseudoSourceValue.h"
      30             : #include "llvm/CodeGen/SlotIndexes.h"
      31             : #include "llvm/CodeGen/TargetInstrInfo.h"
      32             : #include "llvm/CodeGen/TargetRegisterInfo.h"
      33             : #include "llvm/CodeGen/TargetSubtargetInfo.h"
      34             : #include "llvm/Pass.h"
      35             : #include "llvm/Support/Casting.h"
      36             : #include "llvm/Support/CommandLine.h"
      37             : #include "llvm/Support/Debug.h"
      38             : #include "llvm/Support/raw_ostream.h"
      39             : #include <algorithm>
      40             : #include <cassert>
      41             : #include <cstdint>
      42             : #include <iterator>
      43             : #include <vector>
      44             : 
      45             : using namespace llvm;
      46             : 
      47             : #define DEBUG_TYPE "stack-slot-coloring"
      48             : 
      49             : static cl::opt<bool>
      50      101169 : DisableSharing("no-stack-slot-sharing",
      51      202338 :              cl::init(false), cl::Hidden,
      52      303507 :              cl::desc("Suppress slot sharing during stack coloring"));
      53             : 
      54      101169 : static cl::opt<int> DCELimit("ssc-dce-limit", cl::init(-1), cl::Hidden);
      55             : 
      56             : STATISTIC(NumEliminated, "Number of stack slots eliminated due to coloring");
      57             : STATISTIC(NumDead,       "Number of trivially dead stack accesses eliminated");
      58             : 
      59             : namespace {
      60             : 
      61       75048 :   class StackSlotColoring : public MachineFunctionPass {
      62             :     LiveStacks* LS;
      63             :     MachineFrameInfo *MFI;
      64             :     const TargetInstrInfo  *TII;
      65             :     const MachineBlockFrequencyInfo *MBFI;
      66             : 
      67             :     // SSIntervals - Spill slot intervals.
      68             :     std::vector<LiveInterval*> SSIntervals;
      69             : 
      70             :     // SSRefs - Keep a list of MachineMemOperands for each spill slot.
      71             :     // MachineMemOperands can be shared between instructions, so we need
      72             :     // to be careful that renames like [FI0, FI1] -> [FI1, FI2] do not
      73             :     // become FI0 -> FI1 -> FI2.
      74             :     SmallVector<SmallVector<MachineMemOperand *, 8>, 16> SSRefs;
      75             : 
      76             :     // OrigAlignments - Alignments of stack objects before coloring.
      77             :     SmallVector<unsigned, 16> OrigAlignments;
      78             : 
      79             :     // OrigSizes - Sizess of stack objects before coloring.
      80             :     SmallVector<unsigned, 16> OrigSizes;
      81             : 
      82             :     // AllColors - If index is set, it's a spill slot, i.e. color.
      83             :     // FIXME: This assumes PEI locate spill slot with smaller indices
      84             :     // closest to stack pointer / frame pointer. Therefore, smaller
      85             :     // index == better color.
      86             :     BitVector AllColors;
      87             : 
      88             :     // NextColor - Next "color" that's not yet used.
      89             :     int NextColor = -1;
      90             : 
      91             :     // UsedColors - "Colors" that have been assigned.
      92             :     BitVector UsedColors;
      93             : 
      94             :     // Assignments - Color to intervals mapping.
      95             :     SmallVector<SmallVector<LiveInterval*,4>, 16> Assignments;
      96             : 
      97             :   public:
      98             :     static char ID; // Pass identification
      99             : 
     100       37726 :     StackSlotColoring() : MachineFunctionPass(ID) {
     101       18863 :       initializeStackSlotColoringPass(*PassRegistry::getPassRegistry());
     102       18863 :     }
     103             : 
     104       18720 :     void getAnalysisUsage(AnalysisUsage &AU) const override {
     105       18720 :       AU.setPreservesCFG();
     106             :       AU.addRequired<SlotIndexes>();
     107             :       AU.addPreserved<SlotIndexes>();
     108             :       AU.addRequired<LiveStacks>();
     109             :       AU.addRequired<MachineBlockFrequencyInfo>();
     110             :       AU.addPreserved<MachineBlockFrequencyInfo>();
     111       18720 :       AU.addPreservedID(MachineDominatorsID);
     112       18720 :       MachineFunctionPass::getAnalysisUsage(AU);
     113       18720 :     }
     114             : 
     115             :     bool runOnMachineFunction(MachineFunction &MF) override;
     116             : 
     117             :   private:
     118             :     void InitializeSlots();
     119             :     void ScanForSpillSlotRefs(MachineFunction &MF);
     120             :     bool OverlapWithAssignments(LiveInterval *li, int Color) const;
     121             :     int ColorSlot(LiveInterval *li);
     122             :     bool ColorSlots(MachineFunction &MF);
     123             :     void RewriteInstruction(MachineInstr &MI, SmallVectorImpl<int> &SlotMapping,
     124             :                             MachineFunction &MF);
     125             :     bool RemoveDeadStores(MachineBasicBlock* MBB);
     126             :   };
     127             : 
     128             : } // end anonymous namespace
     129             : 
     130             : char StackSlotColoring::ID = 0;
     131             : 
     132             : char &llvm::StackSlotColoringID = StackSlotColoring::ID;
     133             : 
     134       26770 : INITIALIZE_PASS_BEGIN(StackSlotColoring, DEBUG_TYPE,
     135             :                 "Stack Slot Coloring", false, false)
     136       26770 : INITIALIZE_PASS_DEPENDENCY(SlotIndexes)
     137       26770 : INITIALIZE_PASS_DEPENDENCY(LiveStacks)
     138       26770 : INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo)
     139      185838 : INITIALIZE_PASS_END(StackSlotColoring, DEBUG_TYPE,
     140             :                 "Stack Slot Coloring", false, false)
     141             : 
     142             : namespace {
     143             : 
     144             : // IntervalSorter - Comparison predicate that sort live intervals by
     145             : // their weight.
     146             : struct IntervalSorter {
     147             :   bool operator()(LiveInterval* LHS, LiveInterval* RHS) const {
     148             :     return LHS->weight > RHS->weight;
     149             :   }
     150             : };
     151             : 
     152             : } // end anonymous namespace
     153             : 
     154             : /// ScanForSpillSlotRefs - Scan all the machine instructions for spill slot
     155             : /// references and update spill slot weights.
     156        3895 : void StackSlotColoring::ScanForSpillSlotRefs(MachineFunction &MF) {
     157        7790 :   SSRefs.resize(MFI->getObjectIndexEnd());
     158             : 
     159             :   // FIXME: Need the equivalent of MachineRegisterInfo for frameindex operands.
     160             :   for (MachineFunction::iterator MBBI = MF.begin(), E = MF.end();
     161       90522 :        MBBI != E; ++MBBI) {
     162             :     MachineBasicBlock *MBB = &*MBBI;
     163       86627 :     for (MachineBasicBlock::iterator MII = MBB->begin(), EE = MBB->end();
     164     1224021 :          MII != EE; ++MII) {
     165             :       MachineInstr &MI = *MII;
     166     7127996 :       for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
     167     5990602 :         MachineOperand &MO = MI.getOperand(i);
     168     5990602 :         if (!MO.isFI())
     169     5875800 :           continue;
     170      114802 :         int FI = MO.getIndex();
     171      114802 :         if (FI < 0)
     172        5165 :           continue;
     173      219274 :         if (!LS->hasInterval(FI))
     174       59563 :           continue;
     175             :         LiveInterval &li = LS->getInterval(FI);
     176       50074 :         if (!MI.isDebugValue())
     177       49501 :           li.weight += LiveIntervals::getSpillWeight(false, true, MBFI, MI);
     178             :       }
     179     1666040 :       for (MachineInstr::mmo_iterator MMOI = MI.memoperands_begin(),
     180     1137394 :                                       EE = MI.memoperands_end();
     181     1666040 :            MMOI != EE; ++MMOI) {
     182      528646 :         MachineMemOperand *MMO = *MMOI;
     183      480962 :         if (const FixedStackPseudoSourceValue *FSV =
     184             :             dyn_cast_or_null<FixedStackPseudoSourceValue>(
     185             :                 MMO->getPseudoValue())) {
     186       59089 :           int FI = FSV->getFrameIndex();
     187       59089 :           if (FI >= 0)
     188      108396 :             SSRefs[FI].push_back(MMO);
     189             :         }
     190             :       }
     191             :     }
     192             :   }
     193        3895 : }
     194             : 
     195             : /// InitializeSlots - Process all spill stack slot liveintervals and add them
     196             : /// to a sorted (by weight) list.
     197        3895 : void StackSlotColoring::InitializeSlots() {
     198        3895 :   int LastFI = MFI->getObjectIndexEnd();
     199        3895 :   OrigAlignments.resize(LastFI);
     200        3895 :   OrigSizes.resize(LastFI);
     201        3895 :   AllColors.resize(LastFI);
     202        3895 :   UsedColors.resize(LastFI);
     203        3895 :   Assignments.resize(LastFI);
     204             : 
     205             :   using Pair = std::iterator_traits<LiveStacks::iterator>::value_type;
     206             : 
     207             :   SmallVector<Pair *, 16> Intervals;
     208             : 
     209        7790 :   Intervals.reserve(LS->getNumIntervals());
     210       21880 :   for (auto &I : *LS)
     211       14090 :     Intervals.push_back(&I);
     212             :   llvm::sort(Intervals.begin(), Intervals.end(),
     213             :              [](Pair *LHS, Pair *RHS) { return LHS->first < RHS->first; });
     214             : 
     215             :   // Gather all spill slots into a list.
     216             :   LLVM_DEBUG(dbgs() << "Spill slot intervals:\n");
     217       32075 :   for (auto *I : Intervals) {
     218       14090 :     LiveInterval &li = I->second;
     219             :     LLVM_DEBUG(li.dump());
     220       14090 :     int FI = TargetRegisterInfo::stackSlot2Index(li.reg);
     221       28180 :     if (MFI->isDeadObjectIndex(FI))
     222           0 :       continue;
     223       28180 :     SSIntervals.push_back(&li);
     224       28180 :     OrigAlignments[FI] = MFI->getObjectAlignment(FI);
     225       28180 :     OrigSizes[FI]      = MFI->getObjectSize(FI);
     226             :     AllColors.set(FI);
     227             :   }
     228             :   LLVM_DEBUG(dbgs() << '\n');
     229             : 
     230             :   // Sort them by weight.
     231             :   std::stable_sort(SSIntervals.begin(), SSIntervals.end(), IntervalSorter());
     232             : 
     233             :   // Get first "color".
     234        3895 :   NextColor = AllColors.find_first();
     235        3895 : }
     236             : 
     237             : /// OverlapWithAssignments - Return true if LiveInterval overlaps with any
     238             : /// LiveIntervals that have already been assigned to the specified color.
     239             : bool
     240      332283 : StackSlotColoring::OverlapWithAssignments(LiveInterval *li, int Color) const {
     241      332283 :   const SmallVectorImpl<LiveInterval *> &OtherLIs = Assignments[Color];
     242      364569 :   for (unsigned i = 0, e = OtherLIs.size(); i != e; ++i) {
     243      723992 :     LiveInterval *OtherLI = OtherLIs[i];
     244      723992 :     if (OtherLI->overlaps(*li))
     245             :       return true;
     246             :   }
     247             :   return false;
     248             : }
     249             : 
     250             : /// ColorSlot - Assign a "color" (stack slot) to the specified stack slot.
     251       14090 : int StackSlotColoring::ColorSlot(LiveInterval *li) {
     252             :   int Color = -1;
     253             :   bool Share = false;
     254       14090 :   int FI = TargetRegisterInfo::stackSlot2Index(li->reg);
     255             : 
     256       14090 :   if (!DisableSharing) {
     257             :     // Check if it's possible to reuse any of the used colors.
     258       14090 :     Color = UsedColors.find_first();
     259      673510 :     while (Color != -1) {
     260      332283 :       if (!OverlapWithAssignments(li, Color)) {
     261             :         Share = true;
     262             :         ++NumEliminated;
     263             :         break;
     264             :       }
     265      329710 :       Color = UsedColors.find_next(Color);
     266             :     }
     267             :   }
     268             : 
     269       16663 :   if (Color != -1 && MFI->getStackID(Color) != MFI->getStackID(FI)) {
     270             :     LLVM_DEBUG(dbgs() << "cannot share FIs with different stack IDs\n");
     271             :     Share = false;
     272             :   }
     273             : 
     274             :   // Assign it to the first available color (assumed to be the best) if it's
     275             :   // not possible to share a used color with other objects.
     276       14089 :   if (!Share) {
     277             :     assert(NextColor != -1 && "No more spill slots?");
     278       11518 :     Color = NextColor;
     279       11518 :     UsedColors.set(Color);
     280       23036 :     NextColor = AllColors.find_next(NextColor);
     281             :   }
     282             : 
     283             :   // Record the assignment.
     284       28180 :   Assignments[Color].push_back(li);
     285             :   LLVM_DEBUG(dbgs() << "Assigning fi#" << FI << " to fi#" << Color << "\n");
     286             : 
     287             :   // Change size and alignment of the allocated slot. If there are multiple
     288             :   // objects sharing the same slot, then make sure the size and alignment
     289             :   // are large enough for all.
     290       28180 :   unsigned Align = OrigAlignments[FI];
     291       16662 :   if (!Share || Align > MFI->getObjectAlignment(Color))
     292       11582 :     MFI->setObjectAlignment(Color, Align);
     293       14090 :   int64_t Size = OrigSizes[FI];
     294       16662 :   if (!Share || Size > MFI->getObjectSize(Color))
     295       11584 :     MFI->setObjectSize(Color, Size);
     296       14090 :   return Color;
     297             : }
     298             : 
     299             : /// Colorslots - Color all spill stack slots and rewrite all frameindex machine
     300             : /// operands in the function.
     301        3895 : bool StackSlotColoring::ColorSlots(MachineFunction &MF) {
     302        3895 :   unsigned NumObjs = MFI->getObjectIndexEnd();
     303        7790 :   SmallVector<int, 16> SlotMapping(NumObjs, -1);
     304        7790 :   SmallVector<float, 16> SlotWeights(NumObjs, 0.0);
     305        7790 :   SmallVector<SmallVector<int, 4>, 16> RevMap(NumObjs);
     306        3895 :   BitVector UsedColors(NumObjs);
     307             : 
     308             :   LLVM_DEBUG(dbgs() << "Color spill slot intervals:\n");
     309             :   bool Changed = false;
     310       21880 :   for (unsigned i = 0, e = SSIntervals.size(); i != e; ++i) {
     311       28180 :     LiveInterval *li = SSIntervals[i];
     312       28180 :     int SS = TargetRegisterInfo::stackSlot2Index(li->reg);
     313       14090 :     int NewSS = ColorSlot(li);
     314             :     assert(NewSS >= 0 && "Stack coloring failed?");
     315       28180 :     SlotMapping[SS] = NewSS;
     316       28180 :     RevMap[NewSS].push_back(SS);
     317       14090 :     SlotWeights[NewSS] += li->weight;
     318       14090 :     UsedColors.set(NewSS);
     319       14090 :     Changed |= (SS != NewSS);
     320             :   }
     321             : 
     322             :   LLVM_DEBUG(dbgs() << "\nSpill slots after coloring:\n");
     323       21880 :   for (unsigned i = 0, e = SSIntervals.size(); i != e; ++i) {
     324       28180 :     LiveInterval *li = SSIntervals[i];
     325       14090 :     int SS = TargetRegisterInfo::stackSlot2Index(li->reg);
     326       28180 :     li->weight = SlotWeights[SS];
     327             :   }
     328             :   // Sort them by new weight.
     329             :   std::stable_sort(SSIntervals.begin(), SSIntervals.end(), IntervalSorter());
     330             : 
     331             : #ifndef NDEBUG
     332             :   for (unsigned i = 0, e = SSIntervals.size(); i != e; ++i)
     333             :     LLVM_DEBUG(SSIntervals[i]->dump());
     334             :   LLVM_DEBUG(dbgs() << '\n');
     335             : #endif
     336             : 
     337        3895 :   if (!Changed)
     338             :     return false;
     339             : 
     340             :   // Rewrite all MachineMemOperands.
     341       17992 :   for (unsigned SS = 0, SE = SSRefs.size(); SS != SE; ++SS) {
     342       34396 :     int NewFI = SlotMapping[SS];
     343       17198 :     if (NewFI == -1 || (NewFI == (int)SS))
     344       10603 :       continue;
     345             : 
     346        6595 :     const PseudoSourceValue *NewSV = MF.getPSVManager().getFixedStack(NewFI);
     347             :     SmallVectorImpl<MachineMemOperand *> &RefMMOs = SSRefs[SS];
     348       35453 :     for (unsigned i = 0, e = RefMMOs.size(); i != e; ++i)
     349       57716 :       RefMMOs[i]->setValue(NewSV);
     350             :   }
     351             : 
     352             :   // Rewrite all MO_FrameIndex operands.  Look for dead stores.
     353       62386 :   for (MachineBasicBlock &MBB : MF) {
     354      928003 :     for (MachineInstr &MI : MBB)
     355      804819 :       RewriteInstruction(MI, SlotMapping, MF);
     356       61592 :     RemoveDeadStores(&MBB);
     357             :   }
     358             : 
     359             :   // Delete unused stack slots.
     360        5938 :   while (NextColor != -1) {
     361             :     LLVM_DEBUG(dbgs() << "Removing unused stack object fi#" << NextColor
     362             :                       << "\n");
     363        2572 :     MFI->RemoveStackObject(NextColor);
     364        5144 :     NextColor = AllColors.find_next(NextColor);
     365             :   }
     366             : 
     367             :   return true;
     368             : }
     369             : 
     370             : /// RewriteInstruction - Rewrite specified instruction by replacing references
     371             : /// to old frame index with new one.
     372      804819 : void StackSlotColoring::RewriteInstruction(MachineInstr &MI,
     373             :                                            SmallVectorImpl<int> &SlotMapping,
     374             :                                            MachineFunction &MF) {
     375             :   // Update the operands.
     376     5028402 :   for (unsigned i = 0, ee = MI.getNumOperands(); i != ee; ++i) {
     377     4223583 :     MachineOperand &MO = MI.getOperand(i);
     378     4223583 :     if (!MO.isFI())
     379             :       continue;
     380       77594 :     int OldFI = MO.getIndex();
     381       77594 :     if (OldFI < 0)
     382             :       continue;
     383      150328 :     int NewFI = SlotMapping[OldFI];
     384       75164 :     if (NewFI == -1 || NewFI == OldFI)
     385             :       continue;
     386             :     MO.setIndex(NewFI);
     387             :   }
     388             : 
     389             :   // The MachineMemOperands have already been updated.
     390      804819 : }
     391             : 
     392             : /// RemoveDeadStores - Scan through a basic block and look for loads followed
     393             : /// by stores.  If they're both using the same stack slot, then the store is
     394             : /// definitely dead.  This could obviously be much more aggressive (consider
     395             : /// pairs with instructions between them), but such extensions might have a
     396             : /// considerable compile time impact.
     397       61592 : bool StackSlotColoring::RemoveDeadStores(MachineBasicBlock* MBB) {
     398             :   // FIXME: This could be much more aggressive, but we need to investigate
     399             :   // the compile time impact of doing so.
     400             :   bool changed = false;
     401             : 
     402             :   SmallVector<MachineInstr*, 4> toErase;
     403             : 
     404       61592 :   for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
     405      865832 :        I != E; ++I) {
     406      804240 :     if (DCELimit != -1 && (int)NumDead >= DCELimit)
     407             :       break;
     408             :     int FirstSS, SecondSS;
     409     1608481 :     if (TII->isStackSlotCopy(*I, FirstSS, SecondSS) && FirstSS == SecondSS &&
     410             :         FirstSS != -1) {
     411             :       ++NumDead;
     412             :       changed = true;
     413           1 :       toErase.push_back(&*I);
     414      804234 :       continue;
     415             :     }
     416             : 
     417      804239 :     MachineBasicBlock::iterator NextMI = std::next(I);
     418      804239 :     MachineBasicBlock::iterator ProbableLoadMI = I;
     419             : 
     420             :     unsigned LoadReg = 0;
     421             :     unsigned StoreReg = 0;
     422      804239 :     unsigned LoadSize = 0;
     423      804239 :     unsigned StoreSize = 0;
     424     1585259 :     if (!(LoadReg = TII->isLoadFromStackSlot(*I, FirstSS, LoadSize)))
     425             :       continue;
     426             :     // Skip the ...pseudo debugging... instructions between a load and store.
     427       23792 :     while ((NextMI != E) && NextMI->isDebugInstr()) {
     428             :       ++NextMI;
     429             :       ++I;
     430             :     }
     431       23553 :     if (NextMI == E) continue;
     432       22885 :     if (!(StoreReg = TII->isStoreToStackSlot(*NextMI, SecondSS, StoreSize)))
     433             :       continue;
     434         767 :     if (FirstSS != SecondSS || LoadReg != StoreReg || FirstSS == -1 ||
     435           8 :         LoadSize != StoreSize)
     436             :       continue;
     437             : 
     438             :     ++NumDead;
     439             :     changed = true;
     440             : 
     441           6 :     if (NextMI->findRegisterUseOperandIdx(LoadReg, true, nullptr) != -1) {
     442             :       ++NumDead;
     443           6 :       toErase.push_back(&*ProbableLoadMI);
     444             :     }
     445             : 
     446           6 :     toErase.push_back(&*NextMI);
     447             :     ++I;
     448             :   }
     449             : 
     450          13 :   for (SmallVectorImpl<MachineInstr *>::iterator I = toErase.begin(),
     451       61605 :        E = toErase.end(); I != E; ++I)
     452          13 :     (*I)->eraseFromParent();
     453             : 
     454       61592 :   return changed;
     455             : }
     456             : 
     457      180256 : bool StackSlotColoring::runOnMachineFunction(MachineFunction &MF) {
     458             :   LLVM_DEBUG({
     459             :     dbgs() << "********** Stack Slot Coloring **********\n"
     460             :            << "********** Function: " << MF.getName() << '\n';
     461             :   });
     462             : 
     463      180256 :   if (skipFunction(MF.getFunction()))
     464             :     return false;
     465             : 
     466      180119 :   MFI = &MF.getFrameInfo();
     467      180119 :   TII = MF.getSubtarget().getInstrInfo();
     468      180119 :   LS = &getAnalysis<LiveStacks>();
     469      180119 :   MBFI = &getAnalysis<MachineBlockFrequencyInfo>();
     470             : 
     471             :   bool Changed = false;
     472             : 
     473      180119 :   unsigned NumSlots = LS->getNumIntervals();
     474      180119 :   if (NumSlots == 0)
     475             :     // Nothing to do!
     476             :     return false;
     477             : 
     478             :   // If there are calls to setjmp or sigsetjmp, don't perform stack slot
     479             :   // coloring. The stack could be modified before the longjmp is executed,
     480             :   // resulting in the wrong value being used afterwards. (See
     481             :   // <rdar://problem/8007500>.)
     482        3901 :   if (MF.exposesReturnsTwice())
     483             :     return false;
     484             : 
     485             :   // Gather spill slot references
     486        3895 :   ScanForSpillSlotRefs(MF);
     487        3895 :   InitializeSlots();
     488        3895 :   Changed = ColorSlots(MF);
     489             : 
     490        3895 :   NextColor = -1;
     491             :   SSIntervals.clear();
     492       31413 :   for (unsigned i = 0, e = SSRefs.size(); i != e; ++i)
     493       27518 :     SSRefs[i].clear();
     494        3895 :   SSRefs.clear();
     495             :   OrigAlignments.clear();
     496             :   OrigSizes.clear();
     497             :   AllColors.clear();
     498             :   UsedColors.clear();
     499       31413 :   for (unsigned i = 0, e = Assignments.size(); i != e; ++i)
     500       27518 :     Assignments[i].clear();
     501        3895 :   Assignments.clear();
     502             : 
     503        3895 :   return Changed;
     504      303507 : }

Generated by: LCOV version 1.13