diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -5601,6 +5601,25 @@ "equal", *VPCast); } + + switch (VPI.getIntrinsicID()) { + case Intrinsic::vp_fptosi: { + Value *Operand = VPI.getArgOperand(0); + Assert(Operand->getType()->isFPOrFPVectorTy(), + "Intrinsic first argument must be floating point", &VPI); + Assert(VPI.getType()->isIntOrIntVectorTy(), + "Intrinsic result must be an integer", &VPI); + break; + } + case Intrinsic::vp_sitofp: { + Value *Operand = VPI.getArgOperand(0); + Assert(Operand->getType()->isIntOrIntVectorTy(), + "Intrinsic first argument must be an integer", &VPI); + Assert(VPI.getType()->isFPOrFPVectorTy(), + "Intrinsic result must be floating point", &VPI); + break; + } + } } void Verifier::visitConstrainedFPIntrinsic(ConstrainedFPIntrinsic &FPI) {