1
- // ===- SyncDependenceAnalysis.cpp - Divergent Branch Dependence Calculation
2
- // --===//
1
+ // ==- SyncDependenceAnalysis.cpp - Divergent Branch Dependence Calculation -==//
3
2
//
4
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5
4
// See https://llvm.org/LICENSE.txt for license information.
99
98
// loop exit and the loop header (_after_ SSA construction).
100
99
//
101
100
// ===----------------------------------------------------------------------===//
101
+ #include " llvm/Analysis/SyncDependenceAnalysis.h"
102
102
#include " llvm/ADT/PostOrderIterator.h"
103
103
#include " llvm/ADT/SmallPtrSet.h"
104
104
#include " llvm/Analysis/PostDominators.h"
105
- #include " llvm/Analysis/SyncDependenceAnalysis.h"
106
105
#include " llvm/IR/BasicBlock.h"
107
106
#include " llvm/IR/CFG.h"
108
107
#include " llvm/IR/Dominators.h"
@@ -221,7 +220,9 @@ struct DivergencePropagator {
221
220
SuccessorIterable NodeSuccessors, const Loop *ParentLoop) {
222
221
assert (JoinBlocks);
223
222
224
- LLVM_DEBUG (dbgs () << " SDA:computeJoinPoints. Parent loop: " << (ParentLoop ? ParentLoop->getName () : " <null>" ) << " \n " );
223
+ LLVM_DEBUG (dbgs () << " SDA:computeJoinPoints. Parent loop: "
224
+ << (ParentLoop ? ParentLoop->getName () : " <null>" )
225
+ << " \n " );
225
226
226
227
// bootstrap with branch targets
227
228
for (const auto *SuccBlock : NodeSuccessors) {
@@ -236,12 +237,10 @@ struct DivergencePropagator {
236
237
}
237
238
}
238
239
239
- LLVM_DEBUG (
240
- dbgs () << " SDA: rpo order:\n " ;
241
- for (const auto * RpoBlock : FuncRPOT) {
242
- dbgs () << " - " << RpoBlock->getName () << " \n " ;
243
- }
244
- );
240
+ LLVM_DEBUG (dbgs () << " SDA: rpo order:\n " ; for (const auto *RpoBlock
241
+ : FuncRPOT) {
242
+ dbgs () << " - " << RpoBlock->getName () << " \n " ;
243
+ });
245
244
246
245
auto ItBeginRPO = FuncRPOT.begin ();
247
246
auto ItEndRPO = FuncRPOT.end ();
@@ -253,8 +252,7 @@ struct DivergencePropagator {
253
252
254
253
// propagate definitions at the immediate successors of the node in RPO
255
254
auto ItBlockRPO = ItBeginRPO;
256
- while ((++ItBlockRPO != ItEndRPO) &&
257
- !PendingUpdates.empty ()) {
255
+ while ((++ItBlockRPO != ItEndRPO) && !PendingUpdates.empty ()) {
258
256
const auto *Block = *ItBlockRPO;
259
257
LLVM_DEBUG (dbgs () << " SDA::joins. visiting " << Block->getName () << " \n " );
260
258
@@ -311,7 +309,8 @@ struct DivergencePropagator {
311
309
312
310
assert (ParentLoop);
313
311
auto ItHeaderDef = DefMap.find (ParentLoopHeader);
314
- const auto *HeaderDefBlock = (ItHeaderDef == DefMap.end ()) ? nullptr : ItHeaderDef->second ;
312
+ const auto *HeaderDefBlock =
313
+ (ItHeaderDef == DefMap.end ()) ? nullptr : ItHeaderDef->second ;
315
314
316
315
LLVM_DEBUG (printDefs (dbgs ()));
317
316
assert (HeaderDefBlock && " no definition at header of carrying loop" );
0 commit comments