@@ -39,25 +39,25 @@ class SILLoopInfo;
39
39
// / Adds a new argument to an edge between a branch and a destination
40
40
// / block.
41
41
// /
42
- // / \param Branch The terminator to add the argument to.
43
- // / \param Dest The destination block of the edge.
44
- // / \param Val The value to the arguments of the branch.
42
+ // / \param branch The terminator to add the argument to.
43
+ // / \param dest The destination block of the edge.
44
+ // / \param val The value to the arguments of the branch.
45
45
// / \return The created branch. The old branch is deleted.
46
46
// / The argument is appended at the end of the argument tuple.
47
- TermInst *addNewEdgeValueToBranch (TermInst *Branch , SILBasicBlock *Dest ,
48
- SILValue Val );
47
+ TermInst *addNewEdgeValueToBranch (TermInst *branch , SILBasicBlock *dest ,
48
+ SILValue val );
49
49
50
50
// / Changes the edge value between a branch and destination basic block
51
51
// / at the specified index. Changes all edges from \p Branch to \p Dest to carry
52
52
// / the value.
53
53
// /
54
- // / \param Branch The branch to modify.
55
- // / \param Dest The destination of the edge.
56
- // / \param Idx The index of the argument to modify.
57
- // / \param Val The new value to use.
54
+ // / \param branch The branch to modify.
55
+ // / \param dest The destination of the edge.
56
+ // / \param idx The index of the argument to modify.
57
+ // / \param val The new value to use.
58
58
// / \return The new branch. Deletes the old one.
59
- TermInst *changeEdgeValue (TermInst *Branch , SILBasicBlock *Dest , size_t Idx ,
60
- SILValue Val );
59
+ TermInst *changeEdgeValue (TermInst *branch , SILBasicBlock *dest , size_t idx ,
60
+ SILValue val );
61
61
62
62
// / Deletes the edge value between a branch and a destination basic block at the
63
63
// / specified index. Asserts internally that the argument along the edge does
@@ -73,76 +73,80 @@ void erasePhiArgument(SILBasicBlock *block, unsigned argIndex);
73
73
74
74
// / Replace a branch target.
75
75
// /
76
- // / \param T The terminating instruction to modify.
77
- // / \param OldDest The successor block that will be replaced.
78
- // / \param NewDest The new target block.
79
- // / \param PreserveArgs If set, preserve arguments on the replaced edge.
80
- void replaceBranchTarget (TermInst *T , SILBasicBlock *OldDest ,
81
- SILBasicBlock *NewDest , bool PreserveArgs );
76
+ // / \param t The terminating instruction to modify.
77
+ // / \param oldDest The successor block that will be replaced.
78
+ // / \param newDest The new target block.
79
+ // / \param preserveArgs If set, preserve arguments on the replaced edge.
80
+ void replaceBranchTarget (TermInst *t , SILBasicBlock *oldDest ,
81
+ SILBasicBlock *newDest , bool preserveArgs );
82
82
83
83
// / Check if the edge from the terminator is critical.
84
- bool isCriticalEdge (TermInst *T , unsigned EdgeIdx );
84
+ bool isCriticalEdge (TermInst *t , unsigned edgeIdx );
85
85
86
86
// / Splits the edge from terminator if it is critical.
87
87
// /
88
88
// / Updates dominance information and loop information if not null.
89
89
// / Returns the newly created basic block on success or nullptr otherwise (if
90
90
// / the edge was not critical).
91
- SILBasicBlock *splitCriticalEdge (TermInst *T , unsigned EdgeIdx ,
92
- DominanceInfo *DT = nullptr ,
93
- SILLoopInfo *LI = nullptr );
91
+ SILBasicBlock *splitCriticalEdge (TermInst *, unsigned edgeIdx ,
92
+ DominanceInfo *domInfo = nullptr ,
93
+ SILLoopInfo *loopInfo = nullptr );
94
94
95
95
// / Splits the critical edges between from and to. This code assumes there is
96
96
// / exactly one edge between the two basic blocks. It will return the wrong
97
97
// / result if there are multiple edges and will assert if there are no edges in
98
98
// / between the two blocks.
99
99
// /
100
100
// / Updates dominance information and loop information if not null.
101
- SILBasicBlock *splitIfCriticalEdge (SILBasicBlock *From , SILBasicBlock *To ,
102
- DominanceInfo *DT = nullptr ,
103
- SILLoopInfo *LI = nullptr );
101
+ SILBasicBlock *splitIfCriticalEdge (SILBasicBlock *from , SILBasicBlock *to ,
102
+ DominanceInfo *domInfo = nullptr ,
103
+ SILLoopInfo *loopInfo = nullptr );
104
104
105
105
// / Splits all critical edges originating from `fromBB`.
106
- bool splitCriticalEdgesFrom (SILBasicBlock *fromBB, DominanceInfo *DT = nullptr ,
107
- SILLoopInfo *LI = nullptr );
106
+ bool splitCriticalEdgesFrom (SILBasicBlock *fromBB,
107
+ DominanceInfo *domInfo = nullptr ,
108
+ SILLoopInfo *loopInfo = nullptr );
108
109
109
110
// / Splits the edges between two basic blocks.
110
111
// /
111
112
// / Updates dominance information and loop information if not null.
112
- void splitEdgesFromTo (SILBasicBlock *From, SILBasicBlock *To,
113
- DominanceInfo *DT = nullptr , SILLoopInfo *LI = nullptr );
113
+ void splitEdgesFromTo (SILBasicBlock *from, SILBasicBlock *to,
114
+ DominanceInfo *domInfo = nullptr ,
115
+ SILLoopInfo *loopInfo = nullptr );
114
116
115
117
// / Splits the basic block before the instruction with an unconditional branch
116
118
// / and updates the dominator tree and loop info. Returns the new, branched to
117
119
// / block that contains the end of \p SplitBeforeInst's block.
118
- SILBasicBlock *splitBasicBlockAndBranch (SILBuilder &B,
119
- SILInstruction *SplitBeforeInst,
120
- DominanceInfo *DT, SILLoopInfo *LI);
120
+ SILBasicBlock *splitBasicBlockAndBranch (SILBuilder &builder,
121
+ SILInstruction *splitBeforeInst,
122
+ DominanceInfo *domInfo,
123
+ SILLoopInfo *loopInfo);
121
124
122
125
// / Return true if the function has a critical edge, false otherwise.
123
- bool hasCriticalEdges (SILFunction &F , bool OnlyNonCondBr );
126
+ bool hasCriticalEdges (SILFunction &f , bool onlyNonCondBr );
124
127
125
128
// / Split all critical edges in the given function, updating the
126
129
// / dominator tree and loop information if they are provided.
127
130
// /
128
131
// / FIXME: This should never be called! Fix passes that create critical edges.
129
- bool splitAllCriticalEdges (SILFunction &F, DominanceInfo *DT, SILLoopInfo *LI);
132
+ bool splitAllCriticalEdges (SILFunction &F, DominanceInfo *domInfo,
133
+ SILLoopInfo *loopInfo);
130
134
131
135
// / Split all cond_br critical edges with non-trivial arguments in the
132
136
// / function updating the dominator tree and loop information (if they are not
133
137
// / set to null).
134
138
// /
135
139
// / A current invariant of Ownership SIL is that cond_br can only have critical
136
140
// / edges with non-trivial arguments. This simplifies computation.
137
- bool splitAllCondBrCriticalEdgesWithNonTrivialArgs (SILFunction &Fn ,
138
- DominanceInfo *DT ,
139
- SILLoopInfo *LI );
141
+ bool splitAllCondBrCriticalEdgesWithNonTrivialArgs (SILFunction &fn ,
142
+ DominanceInfo *domInfo ,
143
+ SILLoopInfo *loopInfo );
140
144
141
145
// / Merge a basic block ending in a branch with its successor
142
146
// / if possible. If dominance information or loop info is non null update it.
143
147
// / Return true if block was merged.
144
- bool mergeBasicBlockWithSuccessor (SILBasicBlock *BB , DominanceInfo *DT ,
145
- SILLoopInfo *LI );
148
+ bool mergeBasicBlockWithSuccessor (SILBasicBlock *bb , DominanceInfo *domInfo ,
149
+ SILLoopInfo *loopInfo );
146
150
147
151
// / Merge basic blocks in the given function by eliminating all unconditional
148
152
// / branches to single-predecessor branch targets.
@@ -152,7 +156,7 @@ bool mergeBasicBlockWithSuccessor(SILBasicBlock *BB, DominanceInfo *DT,
152
156
// / is not done on-the-fly after splitting blocks because merging is linear in
153
157
// / the number of instructions, so interleaved merging and splitting is
154
158
// / quadratic.
155
- bool mergeBasicBlocks (SILFunction *F );
159
+ bool mergeBasicBlocks (SILFunction *f );
156
160
157
161
// / Given a list of \p UserBlocks and a list of \p DefBlocks, find a set of
158
162
// / blocks that together with \p UserBlocks joint-postdominate \p
@@ -181,11 +185,11 @@ bool mergeBasicBlocks(SILFunction *F);
181
185
// /
182
186
// / *NOTE* This completion may not be unique.
183
187
void completeJointPostDominanceSet (
184
- ArrayRef<SILBasicBlock *> UserBlocks , ArrayRef<SILBasicBlock *> DefBlocks ,
185
- llvm::SmallVectorImpl<SILBasicBlock *> &Completion );
188
+ ArrayRef<SILBasicBlock *> userBlocks , ArrayRef<SILBasicBlock *> defBlocks ,
189
+ llvm::SmallVectorImpl<SILBasicBlock *> &completion );
186
190
187
- // / Return true if we conservatively find all BB 's that are non-failure exit
188
- // / basic blocks and place them in \p BBs . If we find something we don't
191
+ // / Return true if we conservatively find all bb 's that are non-failure exit
192
+ // / basic blocks and place them in \p bbs . If we find something we don't
189
193
// / understand, bail.
190
194
// /
191
195
// / A non-failure exit BB is defined as a BB that:
@@ -202,8 +206,8 @@ void completeJointPostDominanceSet(
202
206
// / implying in most cases this will be one element.
203
207
// /
204
208
// / TODO:
205
- bool findAllNonFailureExitBBs (SILFunction *F ,
206
- llvm::TinyPtrVector<SILBasicBlock *> &BBs );
209
+ bool findAllNonFailureExitBBs (SILFunction *f ,
210
+ llvm::TinyPtrVector<SILBasicBlock *> &bbs );
207
211
208
212
} // end namespace swift
209
213
0 commit comments