summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorKevin P. Neal <kevin.neal@sas.com>2019-10-16 15:24:47 -0400
committerKevin P. Neal <kevin.neal@sas.com>2019-12-17 10:06:51 -0500
commitb1d8576b0a9fa1f6a1173c0b5c2f379389e01e3f (patch)
tree149e22e4bb045e84e2acc66509fa9241683ea320 /llvm/lib/IR/Verifier.cpp
parent1ed832e42446ef8c4afe08f980db2e54ac316bf3 (diff)
downloadbcm5719-llvm-b1d8576b0a9fa1f6a1173c0b5c2f379389e01e3f.tar.gz
bcm5719-llvm-b1d8576b0a9fa1f6a1173c0b5c2f379389e01e3f.zip
This adds constrained intrinsics for the signed and unsigned conversions
of integers to floating point. This includes some of Craig Topper's changes for promotion support from D71130. Differential Revision: https://reviews.llvm.org/D69275
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 3a7da865083..e3a3d91b455 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -4804,6 +4804,28 @@ void Verifier::visitConstrainedFPIntrinsic(ConstrainedFPIntrinsic &FPI) {
}
break;
+ case Intrinsic::experimental_constrained_sitofp:
+ case Intrinsic::experimental_constrained_uitofp: {
+ Value *Operand = FPI.getArgOperand(0);
+ uint64_t NumSrcElem = 0;
+ Assert(Operand->getType()->isIntOrIntVectorTy(),
+ "Intrinsic first argument must be integer", &FPI);
+ if (auto *OperandT = dyn_cast<VectorType>(Operand->getType())) {
+ NumSrcElem = OperandT->getNumElements();
+ }
+
+ Operand = &FPI;
+ Assert((NumSrcElem > 0) == Operand->getType()->isVectorTy(),
+ "Intrinsic first argument and result disagree on vector use", &FPI);
+ Assert(Operand->getType()->isFPOrFPVectorTy(),
+ "Intrinsic result must be a floating point", &FPI);
+ if (auto *OperandT = dyn_cast<VectorType>(Operand->getType())) {
+ Assert(NumSrcElem == OperandT->getNumElements(),
+ "Intrinsic first argument and result vector lengths must be equal",
+ &FPI);
+ }
+ } break;
+
case Intrinsic::experimental_constrained_fptrunc:
case Intrinsic::experimental_constrained_fpext: {
Value *Operand = FPI.getArgOperand(0);
OpenPOWER on IntegriCloud