[cfe-commits] r154745 - in /cfe/trunk: lib/CodeGen/CGExpr.cpp test/CodeGenOpenCL/fpaccuracy.cl test/CodeGenOpenCL/fpmath.cl
Duncan Sands
baldrick at free.fr
Sat Apr 14 05:37:26 PDT 2012
Author: baldrick
Date: Sat Apr 14 07:37:26 2012
New Revision: 154745
URL: http://llvm.org/viewvc/llvm-project?rev=154745&view=rev
Log:
Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'm
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.
Added:
cfe/trunk/test/CodeGenOpenCL/fpmath.cl
- copied, changed from r154487, cfe/trunk/test/CodeGenOpenCL/fpaccuracy.cl
Removed:
cfe/trunk/test/CodeGenOpenCL/fpaccuracy.cl
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=154745&r1=154744&r2=154745&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sat Apr 14 07:37:26 2012
@@ -3174,8 +3174,7 @@
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 {
Removed: cfe/trunk/test/CodeGenOpenCL/fpaccuracy.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/fpaccuracy.cl?rev=154744&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenOpenCL/fpaccuracy.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/fpaccuracy.cl (removed)
@@ -1,25 +0,0 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
-
-typedef __attribute__(( ext_vector_type(4) )) float float4;
-
-float spscalardiv(float a, float b) {
- // CHECK: @spscalardiv
- // CHECK: fdiv{{.*}}, !fpaccuracy ![[MD:[0-9]+]]
- return a / b;
-}
-
-float4 spvectordiv(float4 a, float4 b) {
- // CHECK: @spvectordiv
- // CHECK: fdiv{{.*}}, !fpaccuracy ![[MD]]
- return a / b;
-}
-
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-
-double dpscalardiv(double a, double b) {
- // CHECK: @dpscalardiv
- // CHECK-NOT: !fpaccuracy
- return a / b;
-}
-
-// CHECK: ![[MD]] = metadata !{float 2.500000e+00}
Copied: cfe/trunk/test/CodeGenOpenCL/fpmath.cl (from r154487, cfe/trunk/test/CodeGenOpenCL/fpaccuracy.cl)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/fpmath.cl?p2=cfe/trunk/test/CodeGenOpenCL/fpmath.cl&p1=cfe/trunk/test/CodeGenOpenCL/fpaccuracy.cl&r1=154487&r2=154745&rev=154745&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenOpenCL/fpaccuracy.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/fpmath.cl Sat Apr 14 07:37:26 2012
@@ -4,13 +4,13 @@
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 @@
double dpscalardiv(double a, double b) {
// CHECK: @dpscalardiv
- // CHECK-NOT: !fpaccuracy
+ // CHECK-NOT: !fpmath
return a / b;
}
More information about the cfe-commits
mailing list