[llvm] [Verifier] Make lrint and lround intrinsic cases concise. NFC (PR #105676)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 22 08:12:17 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Sumanth Gundapaneni (sgundapa)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/105676.diff
1 Files Affected:
- (modified) llvm/lib/IR/Verifier.cpp (+9-30)
``````````diff
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;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/105676
More information about the llvm-commits
mailing list