Skip to content

Commit 1c33007

Browse files
committed
Replace if-condition with assert
1 parent 488909d commit 1c33007

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/include/llvm/Analysis/IVDescriptors.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,10 @@ class RecurrenceDescriptor {
266266
/// Returns the sentinel value for FindLastIV recurrences to replace the start
267267
/// value.
268268
Value *getSentinelValue() const {
269-
if (isFindLastIVRecurrenceKind(Kind)) {
270-
Type *Ty = StartValue->getType();
271-
return ConstantInt::get(
272-
Ty, APInt::getSignedMinValue(Ty->getIntegerBitWidth()));
273-
}
274-
return nullptr;
269+
assert(isFindLastIVRecurrenceKind(Kind) && "Unexpected recurrence kind");
270+
Type *Ty = StartValue->getType();
271+
return ConstantInt::get(Ty,
272+
APInt::getSignedMinValue(Ty->getIntegerBitWidth()));
275273
}
276274

277275
/// Returns a reference to the instructions used for type-promoting the

0 commit comments

Comments
 (0)