Re: [PATCH] D20339: Update clang for D20260

2016-06-14 Thread Peter Collingbourne via cfe-commits
pcc added a comment.

Thanks, the patch I committed adds `-cl-opt-disable` to the tests.


Repository:
  rL LLVM

http://reviews.llvm.org/D20339



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20339: Update clang for D20260

2016-06-14 Thread Peter Collingbourne via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272710: Update clang for D20348 (authored by pcc).

Changed prior to commit:
  http://reviews.llvm.org/D20339?vs=57527=60747#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20339

Files:
  cfe/trunk/lib/CodeGen/CGDecl.cpp
  cfe/trunk/lib/CodeGen/CGExpr.cpp
  cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
  cfe/trunk/lib/CodeGen/CGVTT.cpp
  cfe/trunk/lib/CodeGen/CGVTables.cpp
  cfe/trunk/lib/CodeGen/CodeGenModule.cpp
  cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
  cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
  cfe/trunk/test/CodeGen/attr-func-def.c
  cfe/trunk/test/CodeGen/mips-vector-arg.c
  cfe/trunk/test/CodeGen/packed-arrays.c
  cfe/trunk/test/CodeGen/x86_64-longdouble.c
  cfe/trunk/test/CodeGenCXX/atomicinit.cpp
  cfe/trunk/test/CodeGenCXX/virtual-base-ctor.cpp
  cfe/trunk/test/CodeGenOpenCL/constant-addr-space-globals.cl
  cfe/trunk/test/CodeGenOpenCL/shifts.cl
  cfe/trunk/test/CodeGenOpenCL/str_literals.cl
  cfe/trunk/test/SemaOpenCL/extern.cl

Index: cfe/trunk/lib/CodeGen/CGVTables.cpp
===
--- cfe/trunk/lib/CodeGen/CGVTables.cpp
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp
@@ -606,7 +606,7 @@
   StringRef PureCallName = CGM.getCXXABI().GetPureVirtualCallName();
   PureVirtualFn = CGM.CreateRuntimeFunction(Ty, PureCallName);
   if (auto *F = dyn_cast(PureVirtualFn))
-F->setUnnamedAddr(true);
+F->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
   PureVirtualFn = llvm::ConstantExpr::getBitCast(PureVirtualFn,
  CGM.Int8PtrTy);
 }
@@ -619,7 +619,7 @@
 CGM.getCXXABI().GetDeletedVirtualCallName();
   DeletedVirtualFn = CGM.CreateRuntimeFunction(Ty, DeletedCallName);
   if (auto *F = dyn_cast(DeletedVirtualFn))
-F->setUnnamedAddr(true);
+F->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
   DeletedVirtualFn = llvm::ConstantExpr::getBitCast(DeletedVirtualFn,
  CGM.Int8PtrTy);
 }
@@ -698,7 +698,7 @@
   CGM.setGlobalVisibility(VTable, RD);
 
   // V-tables are always unnamed_addr.
-  VTable->setUnnamedAddr(true);
+  VTable->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
 
   llvm::Constant *RTTI = CGM.GetAddrOfRTTIDescriptor(
   CGM.getContext().getTagDeclType(Base.getBase()));
Index: cfe/trunk/lib/CodeGen/CGVTT.cpp
===
--- cfe/trunk/lib/CodeGen/CGVTT.cpp
+++ cfe/trunk/lib/CodeGen/CGVTT.cpp
@@ -121,7 +121,7 @@
   llvm::GlobalVariable *GV =
 CGM.CreateOrReplaceCXXRuntimeVariable(Name, ArrayType, 
   llvm::GlobalValue::ExternalLinkage);
-  GV->setUnnamedAddr(true);
+  GV->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
   return GV;
 }
 
Index: cfe/trunk/lib/CodeGen/CGDecl.cpp
===
--- cfe/trunk/lib/CodeGen/CGDecl.cpp
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp
@@ -1274,7 +1274,7 @@
llvm::GlobalValue::PrivateLinkage,
constant, Name);
 GV->setAlignment(Loc.getAlignment().getQuantity());
-GV->setUnnamedAddr(true);
+GV->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
 
 Address SrcPtr = Address(GV, Loc.getAlignment());
 if (SrcPtr.getType() != BP)
Index: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
===
--- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
+++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
@@ -1575,7 +1575,7 @@
 
   VTable = CGM.CreateOrReplaceCXXRuntimeVariable(
   Name, ArrayType, llvm::GlobalValue::ExternalLinkage);
-  VTable->setUnnamedAddr(true);
+  VTable->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
 
   if (RD->hasAttr())
 VTable->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);
Index: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
===
--- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
+++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -1712,7 +1712,7 @@
   VTable = new llvm::GlobalVariable(CGM.getModule(), VTableType,
 /*isConstant=*/true, VTableLinkage,
 /*Initializer=*/nullptr, VTableName);
-  VTable->setUnnamedAddr(true);
+  VTable->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
 
   llvm::Comdat *C = nullptr;
   if (!VFTableComesFromAnotherTU &&
@@ -1740,7 +1740,7 @@
 /*AddressSpace=*/0, VFTableLinkage,
 VFTableName.str(), VTableGEP,
 ());
-VFTable->setUnnamedAddr(true);
+

Re: [PATCH] D20339: Update clang for D20260

2016-06-14 Thread Richard Smith via cfe-commits
rsmith accepted this revision.
rsmith added a reviewer: rsmith.
rsmith added a comment.
This revision is now accepted and ready to land.

Adding `-cl-opt-disable` to the tests seems fine as an alternative short-term 
approach; LGTM with that approach (either as part of this change or a separate 
change before/after). In the long term, I agree that it would be better if the 
driver specified the relevant -O flag here.


http://reviews.llvm.org/D20339



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20339: Update clang for D20260

2016-06-14 Thread Peter Collingbourne via cfe-commits
pcc added a comment.

Ping.


http://reviews.llvm.org/D20339



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20339: Update clang for D20260

2016-05-17 Thread Peter Collingbourne via cfe-commits
pcc added inline comments.


Comment at: test/CodeGenOpenCL/constant-addr-space-globals.cl:3
@@ -2,3 +2,3 @@
 
-// CHECK: @array = addrspace({{[0-9]+}}) constant
+// CHECK: @array = local_unnamed_addr addrspace({{[0-9]+}}) constant
 __constant float array[2] = {0.0f, 1.0f};

rsmith wrote:
> Where does this come from? It doesn't look like Clang adds this, and this 
> test does not appear to enable any optimizations.
OpenCL enables optimizations by default in the frontend, see 
`getOptimizationLevel` in `lib/Frontend/CompilerInvocation.cpp`.

It does seem a little weird that we're doing this in the frontend, this should 
probably be a driver feature. I must apologise for me-from-5-years-ago who 
implemented this in r120876.

In the meantime, maybe we should be adding `-cl-opt-disable` to the OpenCL 
codegen tests.


http://reviews.llvm.org/D20339



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20339: Update clang for D20260

2016-05-17 Thread Richard Smith via cfe-commits
rsmith added a subscriber: rsmith.


Comment at: test/CodeGenOpenCL/constant-addr-space-globals.cl:3
@@ -2,3 +2,3 @@
 
-// CHECK: @array = addrspace({{[0-9]+}}) constant
+// CHECK: @array = local_unnamed_addr addrspace({{[0-9]+}}) constant
 __constant float array[2] = {0.0f, 1.0f};

Where does this come from? It doesn't look like Clang adds this, and this test 
does not appear to enable any optimizations.


Comment at: test/CodeGenOpenCL/str_literals.cl:8-9
@@ -7,3 +7,3 @@
 // CHECK-NOT: addrspace(3) unnamed_addr constant
-// CHECK: @x = addrspace(3) constant i8 addrspace(3)*
-// CHECK: @y = addrspace(3) constant i8 addrspace(3)*
+// CHECK: @x = local_unnamed_addr addrspace(3) constant i8 addrspace(3)*
+// CHECK: @y = local_unnamed_addr addrspace(3) constant i8 addrspace(3)*

Likewise.


Comment at: test/SemaOpenCL/extern.cl:4
@@ -3,3 +3,3 @@
 
-// CHECK: @foo = external addrspace(3) constant float
+// CHECK: @foo = external local_unnamed_addr addrspace(3) constant float
 extern constant float foo;

Likewise.


http://reviews.llvm.org/D20339



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D20339: Update clang for D20260

2016-05-17 Thread Peter Collingbourne via cfe-commits
pcc created this revision.
pcc added reviewers: rafael, majnemer.
pcc added a subscriber: cfe-commits.
Herald added subscribers: srhines, danalbert, tberghammer.

http://reviews.llvm.org/D20339

Files:
  lib/CodeGen/CGDecl.cpp
  lib/CodeGen/CGExpr.cpp
  lib/CodeGen/CGOpenMPRuntime.cpp
  lib/CodeGen/CGVTT.cpp
  lib/CodeGen/CGVTables.cpp
  lib/CodeGen/CodeGenModule.cpp
  lib/CodeGen/ItaniumCXXABI.cpp
  lib/CodeGen/MicrosoftCXXABI.cpp
  test/CodeGen/attr-func-def.c
  test/CodeGen/mips-vector-arg.c
  test/CodeGen/packed-arrays.c
  test/CodeGen/x86_64-longdouble.c
  test/CodeGenCXX/atomicinit.cpp
  test/CodeGenCXX/virtual-base-ctor.cpp
  test/CodeGenOpenCL/constant-addr-space-globals.cl
  test/CodeGenOpenCL/shifts.cl
  test/CodeGenOpenCL/str_literals.cl
  test/SemaOpenCL/extern.cl

Index: test/SemaOpenCL/extern.cl
===
--- test/SemaOpenCL/extern.cl
+++ test/SemaOpenCL/extern.cl
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -x cl -cl-std=CL1.2 -emit-llvm -ffake-address-space-map %s -o - -verify | FileCheck %s
 // expected-no-diagnostics
 
-// CHECK: @foo = external addrspace(3) constant float
+// CHECK: @foo = external local_unnamed_addr addrspace(3) constant float
 extern constant float foo;
 
 kernel void test(global float* buf) {
Index: test/CodeGenOpenCL/str_literals.cl
===
--- test/CodeGenOpenCL/str_literals.cl
+++ test/CodeGenOpenCL/str_literals.cl
@@ -5,5 +5,5 @@
 
 // CHECK: unnamed_addr addrspace(3) constant
 // CHECK-NOT: addrspace(3) unnamed_addr constant
-// CHECK: @x = addrspace(3) constant i8 addrspace(3)*
-// CHECK: @y = addrspace(3) constant i8 addrspace(3)*
+// CHECK: @x = local_unnamed_addr addrspace(3) constant i8 addrspace(3)*
+// CHECK: @y = local_unnamed_addr addrspace(3) constant i8 addrspace(3)*
Index: test/CodeGenOpenCL/shifts.cl
===
--- test/CodeGenOpenCL/shifts.cl
+++ test/CodeGenOpenCL/shifts.cl
@@ -5,7 +5,7 @@
 // bits before evaluating. Test this both for variables and constants
 // evaluated in the front-end.
 
-// OPT: @gtest1 = constant i64 2147483648
+// OPT: @gtest1 = local_unnamed_addr constant i64 2147483648
 __constant const unsigned long gtest1 = 1UL << 31;
 
 // NOOPT: @negativeShift32
Index: test/CodeGenOpenCL/constant-addr-space-globals.cl
===
--- test/CodeGenOpenCL/constant-addr-space-globals.cl
+++ test/CodeGenOpenCL/constant-addr-space-globals.cl
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 %s -ffake-address-space-map -emit-llvm -o - | FileCheck %s
 
-// CHECK: @array = addrspace({{[0-9]+}}) constant
+// CHECK: @array = local_unnamed_addr addrspace({{[0-9]+}}) constant
 __constant float array[2] = {0.0f, 1.0f};
 
 kernel void test(global float *out) {
Index: test/CodeGenCXX/virtual-base-ctor.cpp
===
--- test/CodeGenCXX/virtual-base-ctor.cpp
+++ test/CodeGenCXX/virtual-base-ctor.cpp
@@ -8,4 +8,4 @@
 struct B : virtual A { void* x; };
 B x;
 
-// CHECK: @y = global i8 2
+// CHECK: @y = local_unnamed_addr global i8 2
Index: test/CodeGenCXX/atomicinit.cpp
===
--- test/CodeGenCXX/atomicinit.cpp
+++ test/CodeGenCXX/atomicinit.cpp
@@ -1,13 +1,13 @@
 // RUN: %clang_cc1 %s -emit-llvm -O1 -o - -triple=i686-apple-darwin9 -std=c++11 | FileCheck %s
 
-// CHECK-DAG: @PR22043 = global i32 0, align 4
+// CHECK-DAG: @PR22043 = local_unnamed_addr global i32 0, align 4
 typedef _Atomic(int) AtomicInt;
 AtomicInt PR22043 = AtomicInt();
 
-// CHECK-DAG: @_ZN7PR180978constant1aE = global { i16, i8 } { i16 1, i8 6 }, align 4
-// CHECK-DAG: @_ZN7PR180978constant1bE = global { i16, i8 } { i16 2, i8 6 }, align 4
-// CHECK-DAG: @_ZN7PR180978constant1cE = global { i16, i8 } { i16 3, i8 6 }, align 4
-// CHECK-DAG: @_ZN7PR180978constant1yE = global { { i16, i8 }, i32 } { { i16, i8 } { i16 4, i8 6 }, i32 5 }, align 4
+// CHECK-DAG: @_ZN7PR180978constant1aE = local_unnamed_addr global { i16, i8 } { i16 1, i8 6 }, align 4
+// CHECK-DAG: @_ZN7PR180978constant1bE = local_unnamed_addr global { i16, i8 } { i16 2, i8 6 }, align 4
+// CHECK-DAG: @_ZN7PR180978constant1cE = local_unnamed_addr global { i16, i8 } { i16 3, i8 6 }, align 4
+// CHECK-DAG: @_ZN7PR180978constant1yE = local_unnamed_addr global { { i16, i8 }, i32 } { { i16, i8 } { i16 4, i8 6 }, i32 5 }, align 4
 
 struct A {
   _Atomic(int) i;
Index: test/CodeGen/x86_64-longdouble.c
===
--- test/CodeGen/x86_64-longdouble.c
+++ test/CodeGen/x86_64-longdouble.c
@@ -11,12 +11,12 @@
 // Android uses fp128 for long double but other x86_64 targets use x86_fp80.
 
 long double dataLD = 1.0L;
-// ANDROID: @dataLD = global fp128 0xL3FFF, align 16
-// GNU: @dataLD = global x86_fp80 0xK3FFF8000,