[llvm] 3c54aa1 - [Verifier] Make lrint and lround intrinsic cases concise. NFC (#105676)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 22 08:27:24 PDT 2024
Author: Sumanth Gundapaneni
Date: 2024-08-22T10:27:21-05:00
New Revision: 3c54aa14aa5f92ea2c96b85efbc7945ed55451e4
URL: https://github.com/llvm/llvm-project/commit/3c54aa14aa5f92ea2c96b85efbc7945ed55451e4
DIFF: https://github.com/llvm/llvm-project/commit/3c54aa14aa5f92ea2c96b85efbc7945ed55451e4.diff
LOG: [Verifier] Make lrint and lround intrinsic cases concise. NFC (#105676)
Added:
Modified:
llvm/lib/IR/Verifier.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index c095e47996ba17..ac754b5d9638d9 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -5952,44 +5952,23 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
break;
}
case Intrinsic::lrint:
- case Intrinsic::llrint: {
- Type *ValTy = Call.getArgOperand(0)->getType();
- Type *ResultTy = Call.getType();
- Check(
- ValTy->isFPOrFPVectorTy() && ResultTy->isIntOrIntVectorTy(),
- "llvm.lrint, llvm.llrint: argument must be floating-point or vector "
- "of floating-points, and result must be integer or vector of integers",
- &Call);
- Check(ValTy->isVectorTy() == ResultTy->isVectorTy(),
- "llvm.lrint, llvm.llrint: argument and result disagree on vector use",
- &Call);
- if (ValTy->isVectorTy()) {
- Check(cast<VectorType>(ValTy)->getElementCount() ==
- cast<VectorType>(ResultTy)->getElementCount(),
- "llvm.lrint, llvm.llrint: argument must be same length as result",
- &Call);
- }
- break;
- }
+ case Intrinsic::llrint:
case Intrinsic::lround:
case Intrinsic::llround: {
Type *ValTy = Call.getArgOperand(0)->getType();
Type *ResultTy = Call.getType();
auto *VTy = dyn_cast<VectorType>(ValTy);
auto *RTy = dyn_cast<VectorType>(ResultTy);
- Check(
- ValTy->isFPOrFPVectorTy() && ResultTy->isIntOrIntVectorTy(),
- "llvm.lround, llvm.llround: argument must be floating-point or vector "
- "of floating-points, and result must be integer or vector of integers",
- &Call);
- Check(
- ValTy->isVectorTy() == ResultTy->isVectorTy(),
- "llvm.lround, llvm.llround: argument and result disagree on vector use",
- &Call);
+ Check(ValTy->isFPOrFPVectorTy() && ResultTy->isIntOrIntVectorTy(),
+ ExpectedName + ": argument must be floating-point or vector "
+ "of floating-points, and result must be integer or "
+ "vector of integers",
+ &Call);
+ Check(ValTy->isVectorTy() == ResultTy->isVectorTy(),
+ ExpectedName + ": argument and result disagree on vector use", &Call);
if (VTy) {
Check(VTy->getElementCount() == RTy->getElementCount(),
- "llvm.lround, llvm.llround: argument must be same length as result",
- &Call);
+ ExpectedName + ": argument must be same length as result", &Call);
}
break;
}
More information about the llvm-commits
mailing list