Skip to content

Commit a0a9d0c

Browse files
committed
implement feedback
1 parent 9b88979 commit a0a9d0c

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

llvm/lib/Transforms/Utils/FixIrreducible.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,14 @@ static bool fixIrreducible(Cycle &C, CycleInfo &CI, DominatorTree &DT,
294294
// Exactly one of the two successors is the header.
295295
BasicBlock *Succ0 = Branch->getSuccessor(0) == Header ? Header : nullptr;
296296
BasicBlock *Succ1 = Succ0 ? nullptr : Header;
297-
if (!Succ0)
298-
assert(Branch->getSuccessor(1) == Header);
297+
assert(Succ0 || Branch->getSuccessor(1) == Header);
299298
assert(Succ0 || Succ1);
300299
CHub.addBranch(P, Succ0, Succ1);
301300

302301
LLVM_DEBUG(dbgs() << "Added internal branch: " << printBasicBlock(P)
303302
<< " -> " << printBasicBlock(Succ0)
304303
<< (Succ0 && Succ1 ? " " : "") << printBasicBlock(Succ1)
305-
<< "\n");
304+
<< '\n');
306305
} else if (CallBrInst *CallBr = dyn_cast<CallBrInst>(P->getTerminator())) {
307306
for (unsigned I = 0; I < CallBr->getNumSuccessors(); ++I) {
308307
BasicBlock *Succ = CallBr->getSuccessor(I);
@@ -313,7 +312,7 @@ static bool fixIrreducible(Cycle &C, CycleInfo &CI, DominatorTree &DT,
313312
CHub.addBranch(NewSucc, Succ);
314313
LLVM_DEBUG(dbgs() << "Added internal branch: "
315314
<< printBasicBlock(NewSucc) << " -> "
316-
<< printBasicBlock(Succ) << "\n");
315+
<< printBasicBlock(Succ) << '\n');
317316
}
318317
} else {
319318
llvm_unreachable("unsupported block terminator");
@@ -341,7 +340,7 @@ static bool fixIrreducible(Cycle &C, CycleInfo &CI, DominatorTree &DT,
341340
LLVM_DEBUG(dbgs() << "Added external branch: " << printBasicBlock(P)
342341
<< " -> " << printBasicBlock(Succ0)
343342
<< (Succ0 && Succ1 ? " " : "") << printBasicBlock(Succ1)
344-
<< "\n");
343+
<< '\n');
345344
} else if (CallBrInst *CallBr = dyn_cast<CallBrInst>(P->getTerminator())) {
346345
for (unsigned I = 0; I < CallBr->getNumSuccessors(); ++I) {
347346
BasicBlock *Succ = CallBr->getSuccessor(I);
@@ -352,7 +351,7 @@ static bool fixIrreducible(Cycle &C, CycleInfo &CI, DominatorTree &DT,
352351
CHub.addBranch(NewSucc, Succ);
353352
LLVM_DEBUG(dbgs() << "Added external branch: "
354353
<< printBasicBlock(NewSucc) << " -> "
355-
<< printBasicBlock(Succ) << "\n");
354+
<< printBasicBlock(Succ) << '\n');
356355
}
357356
} else {
358357
llvm_unreachable("unsupported block terminator");

llvm/lib/Transforms/Utils/UnifyLoopExits.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static bool unifyLoopExits(DominatorTree &DT, LoopInfo &LI, Loop *L) {
173173
LLVM_DEBUG(dbgs() << "Added extiting branch: " << printBasicBlock(BB)
174174
<< " -> " << printBasicBlock(Succ0)
175175
<< (Succ0 && Succ1 ? " " : "") << printBasicBlock(Succ1)
176-
<< "\n");
176+
<< '\n');
177177
} else if (CallBrInst *CallBr = dyn_cast<CallBrInst>(BB->getTerminator())) {
178178
for (unsigned J = 0; J < CallBr->getNumSuccessors(); ++J) {
179179
BasicBlock *Succ = CallBr->getSuccessor(J);
@@ -195,7 +195,7 @@ static bool unifyLoopExits(DominatorTree &DT, LoopInfo &LI, Loop *L) {
195195
CHub.addBranch(NewSucc, Succ);
196196
LLVM_DEBUG(dbgs() << "Added exiting branch: "
197197
<< printBasicBlock(NewSucc) << " -> "
198-
<< printBasicBlock(Succ) << "\n");
198+
<< printBasicBlock(Succ) << '\n');
199199
}
200200
} else {
201201
llvm_unreachable("unsupported block terminator");

0 commit comments

Comments
 (0)