1//===- StackSlotColoring.cpp - Stack slot coloring pass. ------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the stack slot coloring pass.
10//
11//===----------------------------------------------------------------------===//
12
13#include "llvm/CodeGen/StackSlotColoring.h"
14#include "CodeGenOptions.h"
15#include "llvm/ADT/BitVector.h"
16#include "llvm/ADT/SmallVector.h"
17#include "llvm/ADT/Statistic.h"
18#include "llvm/CodeGen/LiveDebugVariables.h"
19#include "llvm/CodeGen/LiveInterval.h"
20#include "llvm/CodeGen/LiveIntervalUnion.h"
21#include "llvm/CodeGen/LiveIntervals.h"
22#include "llvm/CodeGen/LiveStacks.h"
23#include "llvm/CodeGen/MachineBasicBlock.h"
24#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
25#include "llvm/CodeGen/MachineDominators.h"
26#include "llvm/CodeGen/MachineFrameInfo.h"
27#include "llvm/CodeGen/MachineFunction.h"
28#include "llvm/CodeGen/MachineFunctionPass.h"
29#include "llvm/CodeGen/MachineInstr.h"
30#include "llvm/CodeGen/MachineMemOperand.h"
31#include "llvm/CodeGen/MachineOperand.h"
32#include "llvm/CodeGen/Passes.h"
33#include "llvm/CodeGen/PseudoSourceValue.h"
34#include "llvm/CodeGen/PseudoSourceValueManager.h"
35#include "llvm/CodeGen/SlotIndexes.h"
36#include "llvm/CodeGen/TargetInstrInfo.h"
37#include "llvm/CodeGen/TargetSubtargetInfo.h"
38#include "llvm/InitializePasses.h"
39#include "llvm/Pass.h"
40#include "llvm/Support/Casting.h"
41#include "llvm/Support/Debug.h"
42#include "llvm/Support/raw_ostream.h"
43#include <cassert>
44#include <cstdint>
45#include <iterator>
46#include <vector>
47
48using namespace llvm;
49
50#define DEBUG_TYPE "stack-slot-coloring"
51
52STATISTIC(NumEliminated, "Number of stack slots eliminated due to coloring");
53STATISTIC(NumDead, "Number of trivially dead stack accesses eliminated");
54
55namespace {
56
57class StackSlotColoring {
58 const CodeGenOptions &Opts;
59 MachineFrameInfo *MFI = nullptr;
60 const TargetInstrInfo *TII = nullptr;
61 LiveStacks *LS = nullptr;
62 const MachineBlockFrequencyInfo *MBFI = nullptr;
63 SlotIndexes *Indexes = nullptr;
64
65 // SSIntervals - Spill slot intervals.
66 std::vector<LiveInterval *> SSIntervals;
67
68 // SSRefs - Keep a list of MachineMemOperands for each spill slot.
69 // MachineMemOperands can be shared between instructions, so we need
70 // to be careful that renames like [FI0, FI1] -> [FI1, FI2] do not
71 // become FI0 -> FI1 -> FI2.
72 SmallVector<SmallVector<MachineMemOperand *, 8>, 16> SSRefs;
73
74 // OrigAlignments - Alignments of stack objects before coloring.
75 SmallVector<Align, 16> OrigAlignments;
76
77 // OrigSizes - Sizes of stack objects before coloring.
78 SmallVector<unsigned, 16> OrigSizes;
79
80 // AllColors - If index is set, it's a spill slot, i.e. color.
81 // FIXME: This assumes PEI locate spill slot with smaller indices
82 // closest to stack pointer / frame pointer. Therefore, smaller
83 // index == better color. This is per stack ID.
84 SmallVector<BitVector, 2> AllColors;
85
86 // NextColor - Next "color" that's not yet used. This is per stack ID.
87 SmallVector<int, 2> NextColors = {-1};
88
89 // UsedColors - "Colors" that have been assigned. This is per stack ID
90 SmallVector<BitVector, 2> UsedColors;
91
92 // Join all intervals sharing one color into a single LiveIntervalUnion to
93 // speedup range overlap test.
94 class ColorAssignmentInfo {
95 // Single liverange (used to avoid creation of LiveIntervalUnion).
96 LiveInterval *SingleLI = nullptr;
97 // LiveIntervalUnion to perform overlap test.
98 LiveIntervalUnion *LIU = nullptr;
99 // LiveIntervalUnion has a parameter in its constructor so doing this
100 // dirty magic.
101 uint8_t LIUPad[sizeof(LiveIntervalUnion)];
102
103 public:
104 ~ColorAssignmentInfo() {
105 if (LIU)
106 LIU->~LiveIntervalUnion(); // Dirty magic again.
107 }
108
109 // Return true if LiveInterval overlaps with any
110 // intervals that have already been assigned to this color.
111 bool overlaps(LiveInterval *LI) const {
112 if (LIU)
113 return LiveIntervalUnion::Query(*LI, *LIU).checkInterference();
114 return SingleLI ? SingleLI->overlaps(other: *LI) : false;
115 }
116
117 // Add new LiveInterval to this color.
118 void add(LiveInterval *LI, LiveIntervalUnion::Allocator &Alloc) {
119 assert(!overlaps(LI));
120 if (LIU) {
121 LIU->unify(VirtReg: *LI, Range: *LI);
122 } else if (SingleLI) {
123 LIU = new (LIUPad) LiveIntervalUnion(Alloc);
124 LIU->unify(VirtReg: *SingleLI, Range: *SingleLI);
125 LIU->unify(VirtReg: *LI, Range: *LI);
126 SingleLI = nullptr;
127 } else
128 SingleLI = LI;
129 }
130 };
131
132 LiveIntervalUnion::Allocator LIUAlloc;
133
134 // Assignments - Color to intervals mapping.
135 SmallVector<ColorAssignmentInfo, 16> Assignments;
136
137public:
138 StackSlotColoring(MachineFunction &MF, LiveStacks *LS,
139 MachineBlockFrequencyInfo *MBFI, SlotIndexes *Indexes)
140 : Opts(getCodeGenOptions(MF)), MFI(&MF.getFrameInfo()),
141 TII(MF.getSubtarget().getInstrInfo()), LS(LS), MBFI(MBFI),
142 Indexes(Indexes) {}
143 bool run(MachineFunction &MF);
144
145private:
146 void InitializeSlots();
147 void ScanForSpillSlotRefs(MachineFunction &MF);
148 int ColorSlot(LiveInterval *li);
149 bool ColorSlots(MachineFunction &MF);
150 void RewriteInstruction(MachineInstr &MI, SmallVectorImpl<int> &SlotMapping,
151 MachineFunction &MF);
152 bool RemoveDeadStores(MachineBasicBlock *MBB);
153};
154
155class StackSlotColoringLegacy : public MachineFunctionPass {
156public:
157 static char ID; // Pass identification
158
159 StackSlotColoringLegacy() : MachineFunctionPass(ID) {}
160
161 void getAnalysisUsage(AnalysisUsage &AU) const override {
162 AU.setPreservesCFG();
163 AU.addRequired<SlotIndexesWrapperPass>();
164 AU.addPreserved<SlotIndexesWrapperPass>();
165 AU.addRequired<LiveStacksWrapperLegacy>();
166 AU.addRequired<MachineBlockFrequencyInfoWrapperPass>();
167
168 // In some Target's pipeline, register allocation (RA) might be
169 // split into multiple phases based on register class. So, this pass
170 // may be invoked multiple times requiring it to save these analyses to be
171 // used by RA later.
172 AU.addPreserved<LiveIntervalsWrapperPass>();
173 AU.addPreserved<LiveDebugVariablesWrapperLegacy>();
174
175 MachineFunctionPass::getAnalysisUsage(AU);
176 }
177
178 bool runOnMachineFunction(MachineFunction &MF) override;
179};
180
181} // end anonymous namespace
182
183char StackSlotColoringLegacy::ID = 0;
184
185char &llvm::StackSlotColoringID = StackSlotColoringLegacy::ID;
186
187INITIALIZE_PASS_BEGIN(StackSlotColoringLegacy, DEBUG_TYPE,
188 "Stack Slot Coloring", false, false)
189INITIALIZE_PASS_DEPENDENCY(SlotIndexesWrapperPass)
190INITIALIZE_PASS_DEPENDENCY(LiveStacksWrapperLegacy)
191INITIALIZE_PASS_DEPENDENCY(MachineLoopInfoWrapperPass)
192INITIALIZE_PASS_END(StackSlotColoringLegacy, DEBUG_TYPE, "Stack Slot Coloring",
193 false, false)
194
195namespace {
196
197// IntervalSorter - Comparison predicate that sort live intervals by
198// their weight.
199struct IntervalSorter {
200 bool operator()(LiveInterval* LHS, LiveInterval* RHS) const {
201 return LHS->weight() > RHS->weight();
202 }
203};
204
205} // end anonymous namespace
206
207/// ScanForSpillSlotRefs - Scan all the machine instructions for spill slot
208/// references and update spill slot weights.
209void StackSlotColoring::ScanForSpillSlotRefs(MachineFunction &MF) {
210 SSRefs.resize(N: MFI->getObjectIndexEnd());
211
212 // FIXME: Need the equivalent of MachineRegisterInfo for frameindex operands.
213 for (MachineBasicBlock &MBB : MF) {
214 for (MachineInstr &MI : MBB) {
215 for (const MachineOperand &MO : MI.operands()) {
216 if (!MO.isFI())
217 continue;
218 int FI = MO.getIndex();
219 if (FI < 0)
220 continue;
221 if (!LS->hasInterval(Slot: FI))
222 continue;
223 LiveInterval &li = LS->getInterval(Slot: FI);
224 if (!MI.isDebugInstr())
225 li.incrementWeight(
226 Inc: LiveIntervals::getSpillWeight(isDef: false, isUse: true, MBFI, MI));
227 }
228 for (MachineMemOperand *MMO : MI.memoperands()) {
229 if (const FixedStackPseudoSourceValue *FSV =
230 dyn_cast_or_null<FixedStackPseudoSourceValue>(
231 Val: MMO->getPseudoValue())) {
232 int FI = FSV->getFrameIndex();
233 if (FI >= 0)
234 SSRefs[FI].push_back(Elt: MMO);
235 }
236 }
237 }
238 }
239}
240
241/// InitializeSlots - Process all spill stack slot liveintervals and add them
242/// to a sorted (by weight) list.
243void StackSlotColoring::InitializeSlots() {
244 int LastFI = MFI->getObjectIndexEnd();
245
246 // There is always at least one stack ID.
247 AllColors.resize(N: 1);
248 UsedColors.resize(N: 1);
249
250 OrigAlignments.resize(N: LastFI);
251 OrigSizes.resize(N: LastFI);
252 AllColors[0].resize(N: LastFI);
253 UsedColors[0].resize(N: LastFI);
254 Assignments.resize(N: LastFI);
255
256 using Pair = std::iterator_traits<LiveStacks::iterator>::value_type;
257
258 SmallVector<Pair *, 16> Intervals;
259
260 Intervals.reserve(N: LS->getNumIntervals());
261 for (auto &I : *LS)
262 Intervals.push_back(Elt: &I);
263 llvm::sort(C&: Intervals,
264 Comp: [](Pair *LHS, Pair *RHS) { return LHS->first < RHS->first; });
265
266 // Gather all spill slots into a list.
267 LLVM_DEBUG(dbgs() << "Spill slot intervals:\n");
268 for (auto *I : Intervals) {
269 LiveInterval &li = I->second;
270 LLVM_DEBUG(li.dump());
271 int FI = li.reg().stackSlotIndex();
272 if (MFI->isDeadObjectIndex(ObjectIdx: FI))
273 continue;
274
275 SSIntervals.push_back(x: &li);
276 OrigAlignments[FI] = MFI->getObjectAlign(ObjectIdx: FI);
277 OrigSizes[FI] = MFI->getObjectSize(ObjectIdx: FI);
278
279 auto StackID = MFI->getStackID(ObjectIdx: FI);
280 if (StackID != 0) {
281 if (StackID >= AllColors.size()) {
282 AllColors.resize(N: StackID + 1);
283 UsedColors.resize(N: StackID + 1);
284 }
285 AllColors[StackID].resize(N: LastFI);
286 UsedColors[StackID].resize(N: LastFI);
287 }
288
289 AllColors[StackID].set(FI);
290 }
291 LLVM_DEBUG(dbgs() << '\n');
292
293 // Sort them by weight.
294 llvm::stable_sort(Range&: SSIntervals, C: IntervalSorter());
295
296 NextColors.resize(N: AllColors.size());
297
298 // Get first "color".
299 for (unsigned I = 0, E = AllColors.size(); I != E; ++I)
300 NextColors[I] = AllColors[I].find_first();
301}
302
303/// ColorSlot - Assign a "color" (stack slot) to the specified stack slot.
304int StackSlotColoring::ColorSlot(LiveInterval *li) {
305 int Color = -1;
306 bool Share = false;
307 int FI = li->reg().stackSlotIndex();
308 uint8_t StackID = MFI->getStackID(ObjectIdx: FI);
309
310 if (Opts.stack_slot_sharing) {
311
312 // Check if it's possible to reuse any of the used colors.
313 Color = UsedColors[StackID].find_first();
314 while (Color != -1) {
315 if (!Assignments[Color].overlaps(LI: li)) {
316 Share = true;
317 ++NumEliminated;
318 break;
319 }
320 Color = UsedColors[StackID].find_next(Prev: Color);
321 }
322 }
323
324 if (Color != -1 && MFI->getStackID(ObjectIdx: Color) != MFI->getStackID(ObjectIdx: FI)) {
325 LLVM_DEBUG(dbgs() << "cannot share FIs with different stack IDs\n");
326 Share = false;
327 }
328
329 // Assign it to the first available color (assumed to be the best) if it's
330 // not possible to share a used color with other objects.
331 if (!Share) {
332 assert(NextColors[StackID] != -1 && "No more spill slots?");
333 Color = NextColors[StackID];
334 UsedColors[StackID].set(Color);
335 NextColors[StackID] = AllColors[StackID].find_next(Prev: NextColors[StackID]);
336 }
337
338 assert(MFI->getStackID(Color) == MFI->getStackID(FI));
339
340 // Record the assignment.
341 Assignments[Color].add(LI: li, Alloc&: LIUAlloc);
342 LLVM_DEBUG(dbgs() << "Assigning fi#" << FI << " to fi#" << Color << "\n");
343
344 // Change size and alignment of the allocated slot. If there are multiple
345 // objects sharing the same slot, then make sure the size and alignment
346 // are large enough for all.
347 Align Alignment = OrigAlignments[FI];
348 if (!Share || Alignment > MFI->getObjectAlign(ObjectIdx: Color))
349 MFI->setObjectAlignment(ObjectIdx: Color, Alignment);
350 int64_t Size = OrigSizes[FI];
351 if (!Share || Size > MFI->getObjectSize(ObjectIdx: Color))
352 MFI->setObjectSize(ObjectIdx: Color, Size);
353 return Color;
354}
355
356/// Colorslots - Color all spill stack slots and rewrite all frameindex machine
357/// operands in the function.
358bool StackSlotColoring::ColorSlots(MachineFunction &MF) {
359 unsigned NumObjs = MFI->getObjectIndexEnd();
360 SmallVector<int, 16> SlotMapping(NumObjs, -1);
361 SmallVector<float, 16> SlotWeights(NumObjs, 0.0);
362 SmallVector<SmallVector<int, 4>, 16> RevMap(NumObjs);
363 BitVector UsedColors(NumObjs);
364
365 LLVM_DEBUG(dbgs() << "Color spill slot intervals:\n");
366 bool Changed = false;
367 for (LiveInterval *li : SSIntervals) {
368 int SS = li->reg().stackSlotIndex();
369 int NewSS = ColorSlot(li);
370 assert(NewSS >= 0 && "Stack coloring failed?");
371 SlotMapping[SS] = NewSS;
372 RevMap[NewSS].push_back(Elt: SS);
373 SlotWeights[NewSS] += li->weight();
374 UsedColors.set(NewSS);
375 Changed |= (SS != NewSS);
376 }
377
378 LLVM_DEBUG(dbgs() << "\nSpill slots after coloring:\n");
379 for (LiveInterval *li : SSIntervals) {
380 int SS = li->reg().stackSlotIndex();
381 li->setWeight(SlotWeights[SS]);
382 }
383 // Sort them by new weight.
384 llvm::stable_sort(Range&: SSIntervals, C: IntervalSorter());
385
386#ifndef NDEBUG
387 for (LiveInterval *li : SSIntervals)
388 LLVM_DEBUG(li->dump());
389 LLVM_DEBUG(dbgs() << '\n');
390#endif
391
392 if (!Changed)
393 return false;
394
395 // Rewrite all MachineMemOperands.
396 for (unsigned SS = 0, SE = SSRefs.size(); SS != SE; ++SS) {
397 int NewFI = SlotMapping[SS];
398 if (NewFI == -1 || (NewFI == (int)SS))
399 continue;
400
401 const PseudoSourceValue *NewSV = MF.getPSVManager().getFixedStack(FI: NewFI);
402 SmallVectorImpl<MachineMemOperand *> &RefMMOs = SSRefs[SS];
403 for (MachineMemOperand *MMO : RefMMOs)
404 MMO->setValue(NewSV);
405 }
406
407 // Rewrite all MO_FrameIndex operands. Look for dead stores.
408 for (MachineBasicBlock &MBB : MF) {
409 for (MachineInstr &MI : MBB)
410 RewriteInstruction(MI, SlotMapping, MF);
411 RemoveDeadStores(MBB: &MBB);
412 }
413
414 // Delete unused stack slots.
415 for (int StackID = 0, E = AllColors.size(); StackID != E; ++StackID) {
416 int NextColor = NextColors[StackID];
417 while (NextColor != -1) {
418 LLVM_DEBUG(dbgs() << "Removing unused stack object fi#" << NextColor << "\n");
419 MFI->RemoveStackObject(ObjectIdx: NextColor);
420 NextColor = AllColors[StackID].find_next(Prev: NextColor);
421 }
422 }
423
424 return true;
425}
426
427/// RewriteInstruction - Rewrite specified instruction by replacing references
428/// to old frame index with new one.
429void StackSlotColoring::RewriteInstruction(MachineInstr &MI,
430 SmallVectorImpl<int> &SlotMapping,
431 MachineFunction &MF) {
432 // Update the operands.
433 for (MachineOperand &MO : MI.operands()) {
434 if (!MO.isFI())
435 continue;
436 int OldFI = MO.getIndex();
437 if (OldFI < 0)
438 continue;
439 int NewFI = SlotMapping[OldFI];
440 if (NewFI == -1 || NewFI == OldFI)
441 continue;
442
443 assert(MFI->getStackID(OldFI) == MFI->getStackID(NewFI));
444 MO.setIndex(NewFI);
445 }
446
447 // The MachineMemOperands have already been updated.
448}
449
450/// RemoveDeadStores - Scan through a basic block and look for loads followed
451/// by stores. If they're both using the same stack slot, then the store is
452/// definitely dead. This could obviously be much more aggressive (consider
453/// pairs with instructions between them), but such extensions might have a
454/// considerable compile time impact.
455bool StackSlotColoring::RemoveDeadStores(MachineBasicBlock* MBB) {
456 // FIXME: This could be much more aggressive, but we need to investigate
457 // the compile time impact of doing so.
458 bool changed = false;
459
460 SmallVector<MachineInstr*, 4> toErase;
461
462 for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
463 I != E; ++I) {
464 if (Opts.ssc_dce_limit != -1 && (int)NumDead >= Opts.ssc_dce_limit)
465 break;
466 int FirstSS, SecondSS;
467 if (TII->isStackSlotCopy(MI: *I, DestFrameIndex&: FirstSS, SrcFrameIndex&: SecondSS) && FirstSS == SecondSS &&
468 FirstSS != -1) {
469 ++NumDead;
470 changed = true;
471 toErase.push_back(Elt: &*I);
472 continue;
473 }
474
475 MachineBasicBlock::iterator NextMI = std::next(x: I);
476 MachineBasicBlock::iterator ProbableLoadMI = I;
477
478 Register LoadReg;
479 Register StoreReg;
480 TypeSize LoadSize = TypeSize::getZero();
481 TypeSize StoreSize = TypeSize::getZero();
482 if (!(LoadReg = TII->isLoadFromStackSlot(MI: *I, FrameIndex&: FirstSS, MemBytes&: LoadSize)))
483 continue;
484 // Skip the ...pseudo debugging... instructions between a load and store.
485 while ((NextMI != E) && NextMI->isDebugInstr()) {
486 ++NextMI;
487 ++I;
488 }
489 if (NextMI == E) continue;
490 if (!(StoreReg = TII->isStoreToStackSlot(MI: *NextMI, FrameIndex&: SecondSS, MemBytes&: StoreSize)))
491 continue;
492 // Skip if the stack size is unknown.
493 if (!LoadSize || !StoreSize)
494 continue;
495 if (FirstSS != SecondSS || LoadReg != StoreReg || FirstSS == -1 ||
496 LoadSize != StoreSize || !MFI->isSpillSlotObjectIndex(ObjectIdx: FirstSS))
497 continue;
498
499 ++NumDead;
500 changed = true;
501
502 if (NextMI->findRegisterUseOperandIdx(Reg: LoadReg, /*TRI=*/nullptr, isKill: true) !=
503 -1) {
504 ++NumDead;
505 toErase.push_back(Elt: &*ProbableLoadMI);
506 }
507
508 toErase.push_back(Elt: &*NextMI);
509 ++I;
510 }
511
512 for (MachineInstr *MI : toErase) {
513 if (Indexes)
514 Indexes->removeMachineInstrFromMaps(MI&: *MI);
515 MI->eraseFromParent();
516 }
517
518 return changed;
519}
520
521bool StackSlotColoring::run(MachineFunction &MF) {
522 LLVM_DEBUG({
523 dbgs() << "********** Stack Slot Coloring **********\n"
524 << "********** Function: " << MF.getName() << '\n';
525 });
526
527 bool Changed = false;
528
529 unsigned NumSlots = LS->getNumIntervals();
530 if (NumSlots == 0)
531 // Nothing to do!
532 return false;
533
534 // If there are calls to setjmp or sigsetjmp, don't perform stack slot
535 // coloring. The stack could be modified before the longjmp is executed,
536 // resulting in the wrong value being used afterwards.
537 if (MF.exposesReturnsTwice())
538 return false;
539
540 // Gather spill slot references
541 ScanForSpillSlotRefs(MF);
542 InitializeSlots();
543 Changed = ColorSlots(MF);
544
545 for (int &Next : NextColors)
546 Next = -1;
547
548 SSIntervals.clear();
549 for (auto &RefMMOs : SSRefs)
550 RefMMOs.clear();
551 SSRefs.clear();
552 OrigAlignments.clear();
553 OrigSizes.clear();
554 AllColors.clear();
555 UsedColors.clear();
556 Assignments.clear();
557
558 return Changed;
559}
560
561bool StackSlotColoringLegacy::runOnMachineFunction(MachineFunction &MF) {
562 if (skipFunction(F: MF.getFunction()))
563 return false;
564
565 LiveStacks *LS = &getAnalysis<LiveStacksWrapperLegacy>().getLS();
566 MachineBlockFrequencyInfo *MBFI =
567 &getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI();
568 SlotIndexes *Indexes = &getAnalysis<SlotIndexesWrapperPass>().getSI();
569 StackSlotColoring Impl(MF, LS, MBFI, Indexes);
570 return Impl.run(MF);
571}
572
573PreservedAnalyses
574StackSlotColoringPass::run(MachineFunction &MF,
575 MachineFunctionAnalysisManager &MFAM) {
576 LiveStacks *LS = &MFAM.getResult<LiveStacksAnalysis>(IR&: MF);
577 MachineBlockFrequencyInfo *MBFI =
578 &MFAM.getResult<MachineBlockFrequencyAnalysis>(IR&: MF);
579 SlotIndexes *Indexes = &MFAM.getResult<SlotIndexesAnalysis>(IR&: MF);
580 StackSlotColoring Impl(MF, LS, MBFI, Indexes);
581 bool Changed = Impl.run(MF);
582 if (!Changed)
583 return PreservedAnalyses::all();
584
585 auto PA = getMachineFunctionPassPreservedAnalyses();
586 PA.preserveSet<CFGAnalyses>();
587 PA.preserve<SlotIndexesAnalysis>();
588 PA.preserve<LiveIntervalsAnalysis>();
589 PA.preserve<LiveDebugVariablesAnalysis>();
590 return PA;
591}
592