53
53
#define DEBUG_TYPE " array-property-opt"
54
54
55
55
#include " ArrayOpt.h"
56
- #include " swift/SIL/BasicBlockBits.h"
57
- #include " swift/SIL/CFG.h"
58
- #include " swift/SIL/DebugUtils.h"
59
- #include " swift/SIL/InstructionUtils.h"
60
- #include " swift/SIL/LoopInfo.h"
61
- #include " swift/SIL/Projection.h"
62
- #include " swift/SIL/SILCloner.h"
63
56
#include " swift/SILOptimizer/Analysis/ArraySemantic.h"
64
57
#include " swift/SILOptimizer/Analysis/LoopAnalysis.h"
65
58
#include " swift/SILOptimizer/PassManager/Transforms.h"
66
- #include " swift/SILOptimizer/Utils/BasicBlockOptUtils.h"
67
59
#include " swift/SILOptimizer/Utils/CFGOptUtils.h"
68
60
#include " swift/SILOptimizer/Utils/SILSSAUpdater.h"
61
+ #include " swift/SIL/CFG.h"
62
+ #include " swift/SIL/DebugUtils.h"
63
+ #include " swift/SIL/InstructionUtils.h"
64
+ #include " swift/SIL/Projection.h"
65
+ #include " swift/SIL/LoopInfo.h"
66
+ #include " swift/SIL/BasicBlockBits.h"
67
+ #include " swift/SIL/SILCloner.h"
69
68
#include " llvm/ADT/SmallSet.h"
70
69
#include " llvm/Support/CommandLine.h"
71
70
#include " llvm/Support/Debug.h"
@@ -86,8 +85,6 @@ class ArrayPropertiesAnalysis {
86
85
SILBasicBlock *Preheader;
87
86
DominanceInfo *DomTree;
88
87
89
- SinkAddressProjections sinkProj;
90
-
91
88
llvm::DenseMap<SILFunction *, uint32_t > InstCountCache;
92
89
llvm::SmallSet<SILValue, 16 > HoistableArray;
93
90
@@ -171,18 +168,13 @@ class ArrayPropertiesAnalysis {
171
168
172
169
bool FoundHoistable = false ;
173
170
uint32_t LoopInstCount = 0 ;
174
-
175
171
for (auto *BB : Loop->getBlocks ()) {
176
172
for (auto &Inst : *BB) {
177
173
// Can't clone alloc_stack instructions whose dealloc_stack is outside
178
174
// the loop.
179
175
if (!Loop->canDuplicate (&Inst))
180
176
return false ;
181
177
182
- if (!sinkProj.analyzeAddressProjections (&Inst)) {
183
- return false ;
184
- }
185
-
186
178
ArraySemanticsCall ArrayPropsInst (&Inst, " array.props" , true );
187
179
if (!ArrayPropsInst)
188
180
continue ;
@@ -544,15 +536,10 @@ class RegionCloner : public SILCloner<RegionCloner> {
544
536
for (auto *arg : origBB->getArguments ())
545
537
updateSSAForValue (origBB, arg, SSAUp);
546
538
547
- SinkAddressProjections sinkProj;
548
539
// Update outside used instruction values.
549
540
for (auto &inst : *origBB) {
550
- for (auto result : inst.getResults ()) {
551
- bool success = sinkProj.analyzeAddressProjections (&inst);
552
- assert (success);
553
- sinkProj.cloneProjections ();
541
+ for (auto result : inst.getResults ())
554
542
updateSSAForValue (origBB, result, SSAUp);
555
- }
556
543
}
557
544
}
558
545
}
0 commit comments