diff --git a/include/llvm/Intrinsics.h b/include/llvm/Intrinsics.h index de709cbbe8d..56ecb4f1e61 100644 --- a/include/llvm/Intrinsics.h +++ b/include/llvm/Intrinsics.h @@ -60,7 +60,6 @@ namespace Intrinsic { memset, // Fill memory with a byte value // Standard libm functions. - // Input/Output intrinsics. readport, @@ -68,6 +67,9 @@ namespace Intrinsic { readio, writeio, + // Support for unordered compare intrinsic + isunordered, + //===------------------------------------------------------------------===// // This section defines intrinsic functions used to represent Alpha // instructions. diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 01339e1bb06..82f3645acb1 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -222,6 +222,9 @@ unsigned Function::getIntrinsicID() const { if (getName() == "llvm.gcread") return Intrinsic::gcread; if (getName() == "llvm.gcroot") return Intrinsic::gcroot; break; + case 'i': + if (getName() == "llvm.isunordered") return Intrinsic::isunordered; + break; case 'l': if (getName() == "llvm.longjmp") return Intrinsic::longjmp; break; diff --git a/lib/VMCore/IntrinsicLowering.cpp b/lib/VMCore/IntrinsicLowering.cpp index 1dd819cdb42..38ba73d01f8 100644 --- a/lib/VMCore/IntrinsicLowering.cpp +++ b/lib/VMCore/IntrinsicLowering.cpp @@ -191,6 +191,12 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { (*(CI->op_begin()+1))->getType(), MemsetFCache); break; } + case Intrinsic::isunordered: { + static Function *IsunorderedFCache = 0; + ReplaceCallWith("isunordered", CI, CI->op_begin()+1, CI->op_end(), + (*(CI->op_begin()+1))->getType(), IsunorderedFCache); + break; + } } assert(CI->use_empty() && diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index ef76dff0baf..156b2cc45d1 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -688,6 +688,8 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { break; } + case Intrinsic::isunordered: NumArgs = 2; break; + case Intrinsic::setjmp: NumArgs = 1; break; case Intrinsic::longjmp: NumArgs = 2; break; case Intrinsic::sigsetjmp: NumArgs = 2; break;