Skip to content

Commit 6e544ef

Browse files
sgundapabcahoon
authored andcommitted
[Verifier] Make lrint and lround intrinsic cases concise. NFC (llvm#105676)
(cherry picked from commit 3c54aa1) Change-Id: I4ffb42f5f9ca35e695d41de5c173049e75406a1e
1 parent 9318432 commit 6e544ef

File tree

1 file changed

+9
-30
lines changed

1 file changed

+9
-30
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6038,44 +6038,23 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
60386038
break;
60396039
}
60406040
case Intrinsic::lrint:
6041-
case Intrinsic::llrint: {
6042-
Type *ValTy = Call.getArgOperand(0)->getType();
6043-
Type *ResultTy = Call.getType();
6044-
Check(
6045-
ValTy->isFPOrFPVectorTy() && ResultTy->isIntOrIntVectorTy(),
6046-
"llvm.lrint, llvm.llrint: argument must be floating-point or vector "
6047-
"of floating-points, and result must be integer or vector of integers",
6048-
&Call);
6049-
Check(ValTy->isVectorTy() == ResultTy->isVectorTy(),
6050-
"llvm.lrint, llvm.llrint: argument and result disagree on vector use",
6051-
&Call);
6052-
if (ValTy->isVectorTy()) {
6053-
Check(cast<VectorType>(ValTy)->getElementCount() ==
6054-
cast<VectorType>(ResultTy)->getElementCount(),
6055-
"llvm.lrint, llvm.llrint: argument must be same length as result",
6056-
&Call);
6057-
}
6058-
break;
6059-
}
6041+
case Intrinsic::llrint:
60606042
case Intrinsic::lround:
60616043
case Intrinsic::llround: {
60626044
Type *ValTy = Call.getArgOperand(0)->getType();
60636045
Type *ResultTy = Call.getType();
60646046
auto *VTy = dyn_cast<VectorType>(ValTy);
60656047
auto *RTy = dyn_cast<VectorType>(ResultTy);
6066-
Check(
6067-
ValTy->isFPOrFPVectorTy() && ResultTy->isIntOrIntVectorTy(),
6068-
"llvm.lround, llvm.llround: argument must be floating-point or vector "
6069-
"of floating-points, and result must be integer or vector of integers",
6070-
&Call);
6071-
Check(
6072-
ValTy->isVectorTy() == ResultTy->isVectorTy(),
6073-
"llvm.lround, llvm.llround: argument and result disagree on vector use",
6074-
&Call);
6048+
Check(ValTy->isFPOrFPVectorTy() && ResultTy->isIntOrIntVectorTy(),
6049+
ExpectedName + ": argument must be floating-point or vector "
6050+
"of floating-points, and result must be integer or "
6051+
"vector of integers",
6052+
&Call);
6053+
Check(ValTy->isVectorTy() == ResultTy->isVectorTy(),
6054+
ExpectedName + ": argument and result disagree on vector use", &Call);
60756055
if (VTy) {
60766056
Check(VTy->getElementCount() == RTy->getElementCount(),
6077-
"llvm.lround, llvm.llround: argument must be same length as result",
6078-
&Call);
6057+
ExpectedName + ": argument must be same length as result", &Call);
60796058
}
60806059
break;
60816060
}

0 commit comments

Comments
 (0)