File tree Expand file tree Collapse file tree 8 files changed +21
-16
lines changed Expand file tree Collapse file tree 8 files changed +21
-16
lines changed Original file line number Diff line number Diff line change 12
12
// /
13
13
// / Incrementally compute and represent basic block liveness of a single live
14
14
// / range. The live range is defined by points in the CFG, independent of any
15
- // / particular SSA value. The client initializes liveness with a set of
15
+ // / particular SSA value; however, it must be contiguous. Unlike traditional
16
+ // / variable liveness, a definition within the live range does not create a
17
+ // / "hole" in the live range. The client initializes liveness with a set of
16
18
// / definition blocks, typically a single block. The client then incrementally
17
19
// / updates liveness by providing a set of "interesting" uses one at a time.
18
20
// /
@@ -137,7 +139,10 @@ class PrunedLiveBlocks {
137
139
public:
138
140
bool empty () const { return liveBlocks.empty (); }
139
141
140
- void clear () { liveBlocks.clear (); SWIFT_ASSERT_ONLY (seenUse = false ); }
142
+ void clear () {
143
+ liveBlocks.clear ();
144
+ SWIFT_ASSERT_ONLY (seenUse = false );
145
+ }
141
146
142
147
unsigned numLiveBlocks () const { return liveBlocks.size (); }
143
148
Original file line number Diff line number Diff line change 98
98
99
99
#include " swift/Basic/DAGNodeWorklist.h"
100
100
#include " swift/Basic/SmallPtrSetVector.h"
101
+ #include " swift/SIL/PrunedLiveness.h"
101
102
#include " swift/SIL/SILInstruction.h"
102
103
#include " swift/SILOptimizer/Analysis/DominanceAnalysis.h"
103
104
#include " swift/SILOptimizer/Analysis/NonLocalAccessBlockAnalysis.h"
104
105
#include " swift/SILOptimizer/Utils/InstOptUtils.h"
105
- #include " swift/SILOptimizer/Utils/PrunedLiveness.h"
106
106
#include " llvm/ADT/DenseMap.h"
107
107
#include " llvm/ADT/SetVector.h"
108
108
Original file line number Diff line number Diff line change 30
30
#include " swift/Basic/DAGNodeWorklist.h"
31
31
#include " swift/Basic/SmallPtrSetVector.h"
32
32
#include " swift/SIL/OwnershipUtils.h"
33
+ #include " swift/SIL/PrunedLiveness.h"
33
34
#include " swift/SIL/SILInstruction.h"
34
35
#include " swift/SILOptimizer/Analysis/DominanceAnalysis.h"
35
36
#include " swift/SILOptimizer/Analysis/NonLocalAccessBlockAnalysis.h"
36
37
#include " swift/SILOptimizer/Utils/InstOptUtils.h"
37
- #include " swift/SILOptimizer/Utils/PrunedLiveness.h"
38
38
#include " llvm/ADT/DenseMap.h"
39
39
#include " llvm/ADT/SetVector.h"
40
40
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ target_sources(swiftSIL PRIVATE
13
13
OwnershipUtils.cpp
14
14
PrettyStackTrace.cpp
15
15
Projection.cpp
16
+ PrunedLiveness.cpp
16
17
SILBridging.cpp
17
18
SILInstructionWorklist.cpp
18
19
SILRemarkStreamer.cpp
Original file line number Diff line number Diff line change 15
15
#include " swift/Basic/SmallPtrSetVector.h"
16
16
#include " swift/SIL/InstructionUtils.h"
17
17
#include " swift/SIL/LinearLifetimeChecker.h"
18
- #include " swift/SIL/Projection.h"
19
18
#include " swift/SIL/MemAccessUtils.h"
19
+ #include " swift/SIL/Projection.h"
20
+ #include " swift/SIL/PrunedLiveness.h"
20
21
#include " swift/SIL/SILArgument.h"
21
22
#include " swift/SIL/SILInstruction.h"
22
23
Original file line number Diff line number Diff line change 10
10
//
11
11
// ===----------------------------------------------------------------------===//
12
12
13
- #include " swift/SILOptimizer/Utils /PrunedLiveness.h"
13
+ #include " swift/SIL /PrunedLiveness.h"
14
14
#include " swift/SIL/OwnershipUtils.h"
15
15
16
16
using namespace swift ;
@@ -105,14 +105,13 @@ bool PrunedLiveness::updateForBorrowingOperand(Operand *op) {
105
105
// TODO: Handle reborrowed copies by considering the extended borrow
106
106
// scope. Temporarily bail-out on reborrows because we can't handle uses
107
107
// that aren't dominated by currentDef.
108
- if (!BorrowingOperand (op).visitScopeEndingUses (
109
- [this ](Operand *end) {
110
- if (end->getOperandOwnership () == OperandOwnership::Reborrow) {
111
- return false ;
112
- }
113
- updateForUse (end->getUser (), /* lifetimeEnding*/ false );
114
- return true ;
115
- })) {
108
+ if (!BorrowingOperand (op).visitScopeEndingUses ([this ](Operand *end) {
109
+ if (end->getOperandOwnership () == OperandOwnership::Reborrow) {
110
+ return false ;
111
+ }
112
+ updateForUse (end->getUser (), /* lifetimeEnding*/ false );
113
+ return true ;
114
+ })) {
116
115
return false ;
117
116
}
118
117
return true ;
Original file line number Diff line number Diff line change 35
35
#include " swift/SIL/ApplySite.h"
36
36
#include " swift/SIL/BasicBlockBits.h"
37
37
#include " swift/SIL/OwnershipUtils.h"
38
+ #include " swift/SIL/PrunedLiveness.h"
38
39
#include " swift/SILOptimizer/PassManager/Transforms.h"
39
- #include " swift/SILOptimizer/Utils/PrunedLiveness.h"
40
40
#include " clang/AST/DeclObjC.h"
41
41
#include " llvm/ADT/DenseMap.h"
42
42
#include " llvm/Support/Debug.h"
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ target_sources(swiftSILOptimizer PRIVATE
20
20
OptimizerStatsUtils.cpp
21
21
PartialApplyCombiner.cpp
22
22
PerformanceInlinerUtils.cpp
23
- PrunedLiveness.cpp
24
23
SILInliner.cpp
25
24
SILSSAUpdater.cpp
26
25
SpecializationMangler.cpp
You can’t perform that action at this time.
0 commit comments