summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/CodeGen/SplitKit.h
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2018-04-06 14:26:03 +0000
committerpatrick <patrick@openbsd.org>2018-04-06 14:26:03 +0000
commitbdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch)
treec50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/lib/CodeGen/SplitKit.h
parentPrint a 'p' flag for file descriptors that were opened after pledge(2). (diff)
downloadwireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz
wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/lib/CodeGen/SplitKit.h')
-rw-r--r--gnu/llvm/lib/CodeGen/SplitKit.h53
1 files changed, 30 insertions, 23 deletions
diff --git a/gnu/llvm/lib/CodeGen/SplitKit.h b/gnu/llvm/lib/CodeGen/SplitKit.h
index 9d409e924a3..2dafaf58780 100644
--- a/gnu/llvm/lib/CodeGen/SplitKit.h
+++ b/gnu/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:
@@ -354,7 +357,11 @@ private:
/// recomputed by LiveRangeCalc::extend regardless of the number of defs.
/// This is used for values whose live range doesn't match RegAssign exactly.
/// They could have rematerialized, or back-copies may have been moved.
- void forceRecompute(unsigned RegIdx, const VNInfo *ParentVNI);
+ void forceRecompute(unsigned RegIdx, const VNInfo &ParentVNI);
+
+ /// Calls forceRecompute() on any affected regidx and on ParentVNI
+ /// predecessors in case of a phi definition.
+ void forceRecomputeVNI(const VNInfo &ParentVNI);
/// defFromParent - Define Reg from ParentVNI at UseIdx using either
/// rematerialization or a COPY from parent. Return the new value.
@@ -419,9 +426,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 +543,6 @@ public:
unsigned IntvOut, SlotIndex EnterAfter);
};
-}
+} // end namespace llvm
-#endif
+#endif // LLVM_LIB_CODEGEN_SPLITKIT_H