Skip to content

Commit 3c54aa1

Browse files
authored
[Verifier] Make lrint and lround intrinsic cases concise. NFC (#105676)
1 parent 69332bb commit 3c54aa1

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
@@ -5952,44 +5952,23 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
59525952
break;
59535953
}
59545954
case Intrinsic::lrint:
5955-
case Intrinsic::llrint: {
5956-
Type *ValTy = Call.getArgOperand(0)->getType();
5957-
Type *ResultTy = Call.getType();
5958-
Check(
5959-
ValTy->isFPOrFPVectorTy() && ResultTy->isIntOrIntVectorTy(),
5960-
"llvm.lrint, llvm.llrint: argument must be floating-point or vector "
5961-
"of floating-points, and result must be integer or vector of integers",
5962-
&Call);
5963-
Check(ValTy->isVectorTy() == ResultTy->isVectorTy(),
5964-
"llvm.lrint, llvm.llrint: argument and result disagree on vector use",
5965-
&Call);
5966-
if (ValTy->isVectorTy()) {
5967-
Check(cast<VectorType>(ValTy)->getElementCount() ==
5968-
cast<VectorType>(ResultTy)->getElementCount(),
5969-
"llvm.lrint, llvm.llrint: argument must be same length as result",
5970-
&Call);
5971-
}
5972-
break;
5973-
}
5955+
case Intrinsic::llrint:
59745956
case Intrinsic::lround:
59755957
case Intrinsic::llround: {
59765958
Type *ValTy = Call.getArgOperand(0)->getType();
59775959
Type *ResultTy = Call.getType();
59785960
auto *VTy = dyn_cast<VectorType>(ValTy);
59795961
auto *RTy = dyn_cast<VectorType>(ResultTy);
5980-
Check(
5981-
ValTy->isFPOrFPVectorTy() && ResultTy->isIntOrIntVectorTy(),
5982-
"llvm.lround, llvm.llround: argument must be floating-point or vector "
5983-
"of floating-points, and result must be integer or vector of integers",
5984-
&Call);
5985-
Check(
5986-
ValTy->isVectorTy() == ResultTy->isVectorTy(),
5987-
"llvm.lround, llvm.llround: argument and result disagree on vector use",
5988-
&Call);
5962+
Check(ValTy->isFPOrFPVectorTy() && ResultTy->isIntOrIntVectorTy(),
5963+
ExpectedName + ": argument must be floating-point or vector "
5964+
"of floating-points, and result must be integer or "
5965+
"vector of integers",
5966+
&Call);
5967+
Check(ValTy->isVectorTy() == ResultTy->isVectorTy(),
5968+
ExpectedName + ": argument and result disagree on vector use", &Call);
59895969
if (VTy) {
59905970
Check(VTy->getElementCount() == RTy->getElementCount(),
5991-
"llvm.lround, llvm.llround: argument must be same length as result",
5992-
&Call);
5971+
ExpectedName + ": argument must be same length as result", &Call);
59935972
}
59945973
break;
59955974
}

0 commit comments

Comments
 (0)