]> granicus.if.org Git - clang/commitdiff
Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'm
authorDuncan Sands <baldrick@free.fr>
Sat, 14 Apr 2012 12:37:26 +0000 (12:37 +0000)
committerDuncan Sands <baldrick@free.fr>
Sat, 14 Apr 2012 12:37:26 +0000 (12:37 +0000)
thinking of generalizing it to be able to specify other freedoms beyond accuracy
(such as that NaN's don't have to be respected).  I'd like the 3.1 release (the
first one with this metadata) to have the more generic name already rather than
having to auto-upgrade it in 3.2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154745 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp
test/CodeGenOpenCL/fpmath.cl [moved from test/CodeGenOpenCL/fpaccuracy.cl with 79% similarity]

index a7f5c47bbcaa076d8514d426ceae0d77eefa6515..e0bf9768abe5347eb104acfc2b31fdd78c2d7ed2 100644 (file)
@@ -3174,8 +3174,7 @@ void CodeGenFunction::SetFPAccuracy(llvm::Value *Val, float Accuracy) {
   llvm::Value *ULPs = llvm::ConstantFP::get(Builder.getFloatTy(), Accuracy);
   llvm::MDNode *Node = llvm::MDNode::get(getLLVMContext(), ULPs);
 
-  cast<llvm::Instruction>(Val)->setMetadata(llvm::LLVMContext::MD_fpaccuracy,
-                                            Node);
+  cast<llvm::Instruction>(Val)->setMetadata(llvm::LLVMContext::MD_fpmath, Node);
 }
 
 namespace {
similarity index 79%
rename from test/CodeGenOpenCL/fpaccuracy.cl
rename to test/CodeGenOpenCL/fpmath.cl
index d27316a799f3e553ee7f45e9fa488d1b9404aede..704fcd739ac47cb51979b6a8fa8af2354006f056 100644 (file)
@@ -4,13 +4,13 @@ typedef __attribute__(( ext_vector_type(4) )) float float4;
 
 float spscalardiv(float a, float b) {
   // CHECK: @spscalardiv
-  // CHECK: fdiv{{.*}}, !fpaccuracy ![[MD:[0-9]+]]
+  // CHECK: fdiv{{.*}}, !fpmath ![[MD:[0-9]+]]
   return a / b;
 }
 
 float4 spvectordiv(float4 a, float4 b) {
   // CHECK: @spvectordiv
-  // CHECK: fdiv{{.*}}, !fpaccuracy ![[MD]]
+  // CHECK: fdiv{{.*}}, !fpmath ![[MD]]
   return a / b;
 }
 
@@ -18,7 +18,7 @@ float4 spvectordiv(float4 a, float4 b) {
 
 double dpscalardiv(double a, double b) {
   // CHECK: @dpscalardiv
-  // CHECK-NOT: !fpaccuracy
+  // CHECK-NOT: !fpmath
   return a / b;
 }