diff options
author | Sumanth Gundapaneni <sumanth.gundapaneni@amd.com> | 2024-08-22 10:27:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-22 10:27:21 -0500 |
commit | 3c54aa14aa5f92ea2c96b85efbc7945ed55451e4 (patch) | |
tree | 7bdf5d2d5db57ac2f00f55c210fbe2efe11398f2 /llvm/lib/IR/Verifier.cpp | |
parent | 69332bb8995aef60d830406de12cb79a50390261 (diff) | |
download | llvm-3c54aa14aa5f92ea2c96b85efbc7945ed55451e4.zip llvm-3c54aa14aa5f92ea2c96b85efbc7945ed55451e4.tar.gz llvm-3c54aa14aa5f92ea2c96b85efbc7945ed55451e4.tar.bz2 |
[Verifier] Make lrint and lround intrinsic cases concise. NFC (#105676)
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index c095e47..ac754b5 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; } |