summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SplitKit.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/SplitKit.h')
-rw-r--r--llvm/lib/CodeGen/SplitKit.h47
1 files changed, 25 insertions, 22 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.h b/llvm/lib/CodeGen/SplitKit.h
index 9d409e924a3..c0608893d4e 100644
--- a/llvm/lib/CodeGen/SplitKit.h
+++ b/llvm/lib/CodeGen/SplitKit.h
@@ -1,4 +1,4 @@
-//===-------- SplitKit.h - Toolkit for splitting live ranges ----*- C++ -*-===//
+//===- SplitKit.h - Toolkit for splitting live ranges -----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -17,26 +17,32 @@
#include "LiveRangeCalc.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/IntervalMap.h"
+#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/CodeGen/LiveInterval.h"
+#include "llvm/CodeGen/MachineBasicBlock.h"
+#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/SlotIndexes.h"
+#include "llvm/MC/LaneBitmask.h"
+#include "llvm/Support/Compiler.h"
+#include <utility>
namespace llvm {
-class ConnectedVNInfoEqClasses;
-class LiveInterval;
class LiveIntervals;
class LiveRangeEdit;
class MachineBlockFrequencyInfo;
-class MachineInstr;
+class MachineDominatorTree;
class MachineLoopInfo;
class MachineRegisterInfo;
class TargetInstrInfo;
class TargetRegisterInfo;
class VirtRegMap;
-class VNInfo;
-class raw_ostream;
/// Determines the latest safe point in a block in which we can insert a split,
/// spill or other instruction related with CurLI.
@@ -116,7 +122,7 @@ public:
private:
// Current live interval.
- const LiveInterval *CurLI;
+ const LiveInterval *CurLI = nullptr;
/// Insert Point Analysis.
InsertPointAnalysis IPA;
@@ -200,7 +206,7 @@ public:
/// analyze(li).
unsigned countLiveBlocks(const LiveInterval *li) const;
- typedef SmallPtrSet<const MachineBasicBlock*, 16> BlockPtrSet;
+ using BlockPtrSet = SmallPtrSet<const MachineBasicBlock *, 16>;
/// shouldSplitSingleBlock - Returns true if it would help to create a local
/// live range for the instructions in BI. There is normally no benefit to
@@ -221,7 +227,6 @@ public:
}
};
-
/// SplitEditor - Edit machine code and LiveIntervals for live range
/// splitting.
///
@@ -245,7 +250,6 @@ class LLVM_LIBRARY_VISIBILITY SplitEditor {
const MachineBlockFrequencyInfo &MBFI;
public:
-
/// ComplementSpillMode - Select how the complement live range should be
/// created. SplitEditor automatically creates interval 0 to contain
/// anything that isn't added to another interval. This complement interval
@@ -273,19 +277,18 @@ public:
};
private:
-
/// Edit - The current parent register and new intervals created.
- LiveRangeEdit *Edit;
+ LiveRangeEdit *Edit = nullptr;
/// Index into Edit of the currently open interval.
/// The index 0 is used for the complement, so the first interval started by
/// openIntv will be 1.
- unsigned OpenIdx;
+ unsigned OpenIdx = 0;
/// The current spill mode, selected by reset().
- ComplementSpillMode SpillMode;
+ ComplementSpillMode SpillMode = SM_Partition;
- typedef IntervalMap<SlotIndex, unsigned> RegAssignMap;
+ using RegAssignMap = IntervalMap<SlotIndex, unsigned>;
/// Allocator for the interval map. This will eventually be shared with
/// SlotIndexes and LiveIntervals.
@@ -296,8 +299,8 @@ private:
/// Idx.
RegAssignMap RegAssign;
- typedef PointerIntPair<VNInfo*, 1> ValueForcePair;
- typedef DenseMap<std::pair<unsigned, unsigned>, ValueForcePair> ValueMap;
+ using ValueForcePair = PointerIntPair<VNInfo *, 1>;
+ using ValueMap = DenseMap<std::pair<unsigned, unsigned>, ValueForcePair>;
/// Values - keep track of the mapping from parent values to values in the new
/// intervals. Given a pair (RegIdx, ParentVNI->id), Values contains:
@@ -419,9 +422,9 @@ private:
public:
/// Create a new SplitEditor for editing the LiveInterval analyzed by SA.
/// Newly created intervals will be appended to newIntervals.
- SplitEditor(SplitAnalysis &SA, AliasAnalysis &AA, LiveIntervals&,
- VirtRegMap&, MachineDominatorTree&,
- MachineBlockFrequencyInfo &);
+ SplitEditor(SplitAnalysis &sa, AliasAnalysis &aa, LiveIntervals &lis,
+ VirtRegMap &vrm, MachineDominatorTree &mdt,
+ MachineBlockFrequencyInfo &mbfi);
/// reset - Prepare for a new split.
void reset(LiveRangeEdit&, ComplementSpillMode = SM_Partition);
@@ -536,6 +539,6 @@ public:
unsigned IntvOut, SlotIndex EnterAfter);
};
-}
+} // end namespace llvm
-#endif
+#endif // LLVM_LIB_CODEGEN_SPLITKIT_H
OpenPOWER on IntegriCloud