Skip to content

Commit a17777e

Browse files
committed
Fix nits.
1 parent 5a82b7c commit a17777e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ static LoopExpansionInfo insertLoopExpansion(Instruction *InsertBefore,
114114
// Calculate the main loop trip count and remaining units to cover after the
115115
// loop.
116116
Type *LenType = Len->getType();
117-
IntegerType *ILenType = dyn_cast<IntegerType>(LenType);
118-
assert(ILenType && "expected length to be an integer type!");
117+
IntegerType *ILenType = cast<IntegerType>(LenType);
119118
ConstantInt *CIMainLoopStep = ConstantInt::get(ILenType, MainLoopStep);
120119

121120
Value *LoopUnits = Len;
@@ -162,7 +161,7 @@ static LoopExpansionInfo insertLoopExpansion(Instruction *InsertBefore,
162161
// Instruction (i.e., it cannot be a Constant).
163162
LEI.MainLoopIP = cast<Instruction>(NewIndex);
164163

165-
if (0 < ResidualLoopStep && ResidualLoopStep < MainLoopStep) {
164+
if (ResidualLoopStep > 0 && ResidualLoopStep < MainLoopStep) {
166165
// Loop body for the residual accesses.
167166
BasicBlock *ResLoopBB =
168167
BasicBlock::Create(Ctx, BBNamePrefix + "-expansion-residual-body",

0 commit comments

Comments
 (0)