Skip to content

Commit 88272e4

Browse files
kasuga-fjnikic
andauthored
Apply suggestions from code review
Co-authored-by: Nikita Popov <[email protected]>
1 parent 41fe38a commit 88272e4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/lib/Transforms/Utils/LoopPeel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ PhiAnalyzer::PhiAnalyzer(const Loop &L, unsigned MaxIterations)
221221
assert(MaxIterations > 0 && "no peeling is allowed?");
222222
}
223223

224-
// Test if \p Phi is induction variable or not. It can be checked by using SCEV,
225-
// but it's expensive to calculate it here. Instead, we perform the cheaper
226-
// checks, which cannot detect complex one but enough for some cases.
224+
/// Test if \p Phi is induction variable or not. It can be checked by using SCEV,
225+
/// but it's expensive to calculate it here. Instead, we perform the cheaper
226+
/// checks, which cannot detect complex one but enough for some cases.
227227
bool PhiAnalyzer::isInductionPHI(const PHINode *Phi) const {
228228
// Currently, we only support loops that consist of one basic block. In this
229229
// case, the phi can become an IV if it has an incoming value from the basic
@@ -253,7 +253,7 @@ bool PhiAnalyzer::isInductionPHI(const PHINode *Phi) const {
253253
if (Visited.contains(Cur))
254254
return false;
255255

256-
Instruction *I = dyn_cast<Instruction>(Cur);
256+
auto *I = dyn_cast<Instruction>(Cur);
257257
if (!I || I->getParent() != Phi->getParent())
258258
return false;
259259

llvm/test/Transforms/LoopUnroll/peel-loop-phi-analysis.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ for.body:
287287
%x = phi i32 [ 0, %entry ], [ %y, %for.body ]
288288
%a = phi i32 [ 0, %entry ], [ %add, %for.body ]
289289
%y = phi i32 [ 0, %entry ], [ %a, %for.body ]
290-
tail call void @_Z1gi(i32 signext %x)
291-
tail call void @_Z1gi(i32 signext %a)
290+
tail call void @_Z1gi(i32 %x)
291+
tail call void @_Z1gi(i32 %a)
292292
%add = add nuw nsw i32 %i, 2
293293
%inc = add nuw nsw i32 %i, 1
294294
%exitcond = icmp ne i32 %inc, 100000

0 commit comments

Comments
 (0)