@@ -125,19 +125,6 @@ namespace llvm {
125
125
return (unsigned )(IntervalPercentage * indexes_->getFunctionSize ());
126
126
}
127
127
128
- // / conflictsWithPhysReg - Returns true if the specified register is used or
129
- // / defined during the duration of the specified interval. Copies to and
130
- // / from li.reg are allowed. This method is only able to analyze simple
131
- // / ranges that stay within a single basic block. Anything else is
132
- // / considered a conflict.
133
- bool conflictsWithPhysReg (const LiveInterval &li, VirtRegMap &vrm,
134
- unsigned reg);
135
-
136
- // / conflictsWithAliasRef - Similar to conflictsWithPhysRegRef except
137
- // / it checks for alias uses and defs.
138
- bool conflictsWithAliasRef (LiveInterval &li, unsigned Reg,
139
- SmallPtrSet<MachineInstr*,32 > &JoinedCopies);
140
-
141
128
// Interval creation
142
129
LiveInterval &getOrCreateInterval (unsigned reg) {
143
130
Reg2IntervalMap::iterator I = r2iMap_.find (reg);
@@ -271,41 +258,13 @@ namespace llvm {
271
258
// / print - Implement the dump method.
272
259
virtual void print (raw_ostream &O, const Module* = 0 ) const ;
273
260
274
- // / addIntervalsForSpills - Create new intervals for spilled defs / uses of
275
- // / the given interval. FIXME: It also returns the weight of the spill slot
276
- // / (if any is created) by reference. This is temporary.
277
- std::vector<LiveInterval*>
278
- addIntervalsForSpills (const LiveInterval& i,
279
- const SmallVectorImpl<LiveInterval*> *SpillIs,
280
- const MachineLoopInfo *loopInfo, VirtRegMap& vrm);
281
-
282
- // / spillPhysRegAroundRegDefsUses - Spill the specified physical register
283
- // / around all defs and uses of the specified interval. Return true if it
284
- // / was able to cut its interval.
285
- bool spillPhysRegAroundRegDefsUses (const LiveInterval &li,
286
- unsigned PhysReg, VirtRegMap &vrm);
287
-
288
261
// / isReMaterializable - Returns true if every definition of MI of every
289
262
// / val# of the specified interval is re-materializable. Also returns true
290
263
// / by reference if all of the defs are load instructions.
291
264
bool isReMaterializable (const LiveInterval &li,
292
265
const SmallVectorImpl<LiveInterval*> *SpillIs,
293
266
bool &isLoad);
294
267
295
- // / isReMaterializable - Returns true if the definition MI of the specified
296
- // / val# of the specified interval is re-materializable.
297
- bool isReMaterializable (const LiveInterval &li, const VNInfo *ValNo,
298
- MachineInstr *MI);
299
-
300
- // / getRepresentativeReg - Find the largest super register of the specified
301
- // / physical register.
302
- unsigned getRepresentativeReg (unsigned Reg) const ;
303
-
304
- // / getNumConflictsWithPhysReg - Return the number of uses and defs of the
305
- // / specified interval that conflicts with the specified physical register.
306
- unsigned getNumConflictsWithPhysReg (const LiveInterval &li,
307
- unsigned PhysReg) const ;
308
-
309
268
// / intervalIsInOneMBB - Returns true if the specified interval is entirely
310
269
// / within a single basic block.
311
270
bool intervalIsInOneMBB (const LiveInterval &li) const ;
@@ -379,84 +338,6 @@ namespace llvm {
379
338
const SmallVectorImpl<LiveInterval*> *SpillIs,
380
339
bool &isLoad);
381
340
382
- // / tryFoldMemoryOperand - Attempts to fold either a spill / restore from
383
- // / slot / to reg or any rematerialized load into ith operand of specified
384
- // / MI. If it is successul, MI is updated with the newly created MI and
385
- // / returns true.
386
- bool tryFoldMemoryOperand (MachineInstr* &MI, VirtRegMap &vrm,
387
- MachineInstr *DefMI, SlotIndex InstrIdx,
388
- SmallVector<unsigned , 2 > &Ops,
389
- bool isSS, int FrameIndex, unsigned Reg);
390
-
391
- // / canFoldMemoryOperand - Return true if the specified load / store
392
- // / folding is possible.
393
- bool canFoldMemoryOperand (MachineInstr *MI,
394
- SmallVector<unsigned , 2 > &Ops,
395
- bool ReMatLoadSS) const ;
396
-
397
- // / anyKillInMBBAfterIdx - Returns true if there is a kill of the specified
398
- // / VNInfo that's after the specified index but is within the basic block.
399
- bool anyKillInMBBAfterIdx (const LiveInterval &li, const VNInfo *VNI,
400
- MachineBasicBlock *MBB,
401
- SlotIndex Idx) const ;
402
-
403
- // / hasAllocatableSuperReg - Return true if the specified physical register
404
- // / has any super register that's allocatable.
405
- bool hasAllocatableSuperReg (unsigned Reg) const ;
406
-
407
- // / SRInfo - Spill / restore info.
408
- struct SRInfo {
409
- SlotIndex index;
410
- unsigned vreg;
411
- bool canFold;
412
- SRInfo (SlotIndex i, unsigned vr, bool f)
413
- : index(i), vreg(vr), canFold(f) {}
414
- };
415
-
416
- bool alsoFoldARestore (int Id, SlotIndex index, unsigned vr,
417
- BitVector &RestoreMBBs,
418
- DenseMap<unsigned ,std::vector<SRInfo> >&RestoreIdxes);
419
- void eraseRestoreInfo (int Id, SlotIndex index, unsigned vr,
420
- BitVector &RestoreMBBs,
421
- DenseMap<unsigned ,std::vector<SRInfo> >&RestoreIdxes);
422
-
423
- // / handleSpilledImpDefs - Remove IMPLICIT_DEF instructions which are being
424
- // / spilled and create empty intervals for their uses.
425
- void handleSpilledImpDefs (const LiveInterval &li, VirtRegMap &vrm,
426
- const TargetRegisterClass* rc,
427
- std::vector<LiveInterval*> &NewLIs);
428
-
429
- // / rewriteImplicitOps - Rewrite implicit use operands of MI (i.e. uses of
430
- // / interval on to-be re-materialized operands of MI) with new register.
431
- void rewriteImplicitOps (const LiveInterval &li,
432
- MachineInstr *MI, unsigned NewVReg, VirtRegMap &vrm);
433
-
434
- // / rewriteInstructionForSpills, rewriteInstructionsForSpills - Helper
435
- // / functions for addIntervalsForSpills to rewrite uses / defs for the given
436
- // / live range.
437
- bool rewriteInstructionForSpills (const LiveInterval &li, const VNInfo *VNI,
438
- bool TrySplit, SlotIndex index, SlotIndex end,
439
- MachineInstr *MI, MachineInstr *OrigDefMI, MachineInstr *DefMI,
440
- unsigned Slot, int LdSlot,
441
- bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
442
- VirtRegMap &vrm, const TargetRegisterClass* rc,
443
- SmallVector<int , 4 > &ReMatIds, const MachineLoopInfo *loopInfo,
444
- unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse,
445
- DenseMap<unsigned ,unsigned > &MBBVRegsMap,
446
- std::vector<LiveInterval*> &NewLIs);
447
- void rewriteInstructionsForSpills (const LiveInterval &li, bool TrySplit,
448
- LiveInterval::Ranges::const_iterator &I,
449
- MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot,
450
- bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
451
- VirtRegMap &vrm, const TargetRegisterClass* rc,
452
- SmallVector<int , 4 > &ReMatIds, const MachineLoopInfo *loopInfo,
453
- BitVector &SpillMBBs,
454
- DenseMap<unsigned ,std::vector<SRInfo> > &SpillIdxes,
455
- BitVector &RestoreMBBs,
456
- DenseMap<unsigned ,std::vector<SRInfo> > &RestoreIdxes,
457
- DenseMap<unsigned ,unsigned > &MBBVRegsMap,
458
- std::vector<LiveInterval*> &NewLIs);
459
-
460
341
static LiveInterval* createInterval (unsigned Reg);
461
342
462
343
void printInstrs (raw_ostream &O) const ;
0 commit comments