Skip to content

Commit 9f0048a

Browse files
authored
Merge pull request #15460 from gottesmm/pr-9817133fbc37084c8d1ffa2a3220d85c3947e01c
2 parents 8b9ffd8 + 51b20a2 commit 9f0048a

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/SILOptimizer/IPO/GlobalOpt.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
using namespace swift;
3131

3232
namespace {
33+
3334
/// Optimize the placement of global initializers.
3435
///
3536
/// TODO:
@@ -53,31 +54,31 @@ class SILGlobalOpt {
5354
// Map each global initializer to a list of call sites.
5455
typedef SmallVector<ApplyInst *, 4> GlobalInitCalls;
5556
typedef SmallVector<LoadInst *, 4> GlobalLoads;
56-
llvm::MapVector<SILFunction*, GlobalInitCalls> GlobalInitCallMap;
57+
llvm::MapVector<SILFunction *, GlobalInitCalls> GlobalInitCallMap;
5758

5859
// The following mappings are used if this is a compilation
5960
// in scripting mode and global variables are accessed without
6061
// addressors.
6162

6263
// Map each global let variable to a set of loads from it.
63-
llvm::MapVector<SILGlobalVariable*, GlobalLoads> GlobalLoadMap;
64+
llvm::MapVector<SILGlobalVariable *, GlobalLoads> GlobalLoadMap;
6465
// Map each global let variable to the store instruction which initializes it.
65-
llvm::MapVector<SILGlobalVariable*, StoreInst *> GlobalVarStore;
66+
llvm::MapVector<SILGlobalVariable *, StoreInst *> GlobalVarStore;
6667
// Variables in this set should not be processed by this pass
6768
// anymore.
68-
llvm::SmallPtrSet<SILGlobalVariable*, 16> GlobalVarSkipProcessing;
69+
llvm::SmallPtrSet<SILGlobalVariable *, 16> GlobalVarSkipProcessing;
6970

7071
// Mark any block that this pass has determined to be inside a loop.
71-
llvm::DenseSet<SILBasicBlock*> LoopBlocks;
72+
llvm::DenseSet<SILBasicBlock *> LoopBlocks;
7273
// Mark any functions for which loops have been analyzed.
73-
llvm::DenseSet<SILFunction*> LoopCheckedFunctions;
74+
llvm::DenseSet<SILFunction *> LoopCheckedFunctions;
7475
// Keep track of cold blocks.
7576
ColdBlockInfo ColdBlocks;
7677

7778
// Whether we see a "once" call to callees that we currently don't handle.
7879
bool UnhandledOnceCallee = false;
7980
// Record number of times a globalinit_func is called by "once".
80-
llvm::DenseMap<SILFunction*, unsigned> InitializerCount;
81+
llvm::DenseMap<SILFunction *, unsigned> InitializerCount;
8182
public:
8283
SILGlobalOpt(SILModule *M, DominanceAnalysis *DA)
8384
: Module(M), DA(DA), ColdBlocks(DA) {}
@@ -92,7 +93,7 @@ class SILGlobalOpt {
9293

9394
SILGlobalVariable *getVariableOfGlobalInit(SILFunction *AddrF);
9495
bool isInLoop(SILBasicBlock *CurBB);
95-
void placeInitializers(SILFunction *InitF, ArrayRef<ApplyInst*> Calls);
96+
void placeInitializers(SILFunction *InitF, ArrayRef<ApplyInst *> Calls);
9697

9798
// Update UnhandledOnceCallee and InitializerCount by going through all "once"
9899
// calls.
@@ -417,12 +418,12 @@ static bool isAvailabilityCheckOnDomPath(SILBasicBlock *From, SILBasicBlock *To,
417418
/// The current heuristic hoists all initialization points within a function to
418419
/// a single dominating call in the outer loop preheader.
419420
void SILGlobalOpt::placeInitializers(SILFunction *InitF,
420-
ArrayRef<ApplyInst*> Calls) {
421+
ArrayRef<ApplyInst *> Calls) {
421422
DEBUG(llvm::dbgs() << "GlobalOpt: calls to "
422423
<< Demangle::demangleSymbolAsString(InitF->getName())
423424
<< " : " << Calls.size() << "\n");
424425
// Map each initializer-containing function to its final initializer call.
425-
llvm::DenseMap<SILFunction*, ApplyInst*> ParentFuncs;
426+
llvm::DenseMap<SILFunction *, ApplyInst *> ParentFuncs;
426427
for (auto *AI : Calls) {
427428
assert(AI->getNumArguments() == 0 && "ill-formed global init call");
428429
assert(cast<FunctionRefInst>(AI->getCallee())->getReferencedFunction()

0 commit comments

Comments
 (0)