diff --git a/docs/LangRef.html b/docs/LangRef.html
index 8dca4151720..a12a42b39df 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -103,6 +103,7 @@
+
+
fpaccuracy metadata may be attached to any instruction of floating
+ point type. It expresses the maximum relative error of the result of
+ that instruction, in ULPs. ULP is defined as follows:
+
+
+If x is a real number that lies between two finite consecutive floating-point
+numbers a and b, without being equal to one of them, then ulp(x) = |b - a|,
+otherwise ulp(x) is the distance between the two non-equal finite
+floating-point numbers nearest x. Moreover, ulp(NaN) is NaN.
+
+
+
The maximum relative error may be any rational number. The metadata node
+ shall consist of a pair of unsigned integers respectively representing
+ the numerator and denominator. For example, 2.5 ULP:
+
+
+
+!0 = metadata !{ i32 5, i32 2 }
+
+
+
+
+
diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h
index 65146c31aaa..1c5063011d7 100644
--- a/include/llvm/LLVMContext.h
+++ b/include/llvm/LLVMContext.h
@@ -40,7 +40,8 @@ public:
enum {
MD_dbg = 0, // "dbg"
MD_tbaa = 1, // "tbaa"
- MD_prof = 2 // "prof"
+ MD_prof = 2, // "prof"
+ MD_fpaccuracy = 3 // "fpaccuracy"
};
/// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp
index 3ed2c2c7e9e..e1a9b177243 100644
--- a/lib/VMCore/LLVMContext.cpp
+++ b/lib/VMCore/LLVMContext.cpp
@@ -43,6 +43,11 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) {
// Create the 'prof' metadata kind.
unsigned ProfID = getMDKindID("prof");
assert(ProfID == MD_prof && "prof kind id drifted"); (void)ProfID;
+
+ // Create the 'fpaccuracy' metadata kind.
+ unsigned FPAccuracyID = getMDKindID("fpaccuracy");
+ assert(FPAccuracyID == MD_fpaccuracy && "fpaccuracy kind id drifted");
+ (void)FPAccuracyID;
}
LLVMContext::~LLVMContext() { delete pImpl; }