Skip to content

Commit 9fb8ffe

Browse files
Update clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
Co-authored-by: Balazs Benics <[email protected]>
1 parent 9ae83de commit 9fb8ffe

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,8 @@ static bool shouldCompletelyUnroll(const Stmt *LoopStmt, ASTContext &ASTCtx,
285285
auto CondOp = Matches[0].getNodeAs<BinaryOperator>("conditionOperator");
286286
unsigned MaxWidth = std::max(InitNum.getBitWidth(), BoundNum.getBitWidth());
287287

288-
if (InitNum.getBitWidth() != MaxWidth)
289-
InitNum = InitNum.zext(MaxWidth);
290-
if (BoundNum.getBitWidth() != MaxWidth)
291-
BoundNum = BoundNum.zext(MaxWidth);
288+
InitNum = InitNum.zext(MaxWidth);
289+
BoundNum = BoundNum.zext(MaxWidth);
292290

293291
if (CondOp->getOpcode() == BO_GE || CondOp->getOpcode() == BO_LE)
294292
maxStep = (BoundNum - InitNum + 1).abs().getZExtValue();

0 commit comments

Comments
 (0)