[PATCH] D75171: [Analyzer] Fix for incorrect use of container and iterator checkers

2021-09-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment.
Herald added a subscriber: manas.

In D75171#1954405 , @Szelethus wrote:

> In D75171#1954279 , @sylvestre.ledru 
> wrote:
>
>> @baloghadamsoftware @Szelethus it would be great to have the name of the 
>> checkers in the error message
>> The error is "error: checker cannot be enabled with analyzer option 
>> 'aggressive-binary-operation-simplification' == false"
>> and I had to look at this patch to understand that it is about iterator
>
> Huh, that is a fair point -- Adam, can you patch it in please?

IMO enabling the checker should imply enabling all the //required// options as 
well. So, I see very little value in this error message, not to mention that we 
won't know which checkers to blame.
It's also really bad for //git bisecting//, when e.g. someone is simply 
enabling the `alpha` checkers. Suddenly, sometimes in the process, you have to 
pass this checker option, and in some other bisect cases, you must not pass 
them, because those are not yet recognized.
This happened a couple of times for example reducing crashes.

So, I think we should reiterate this issue.
What's your take on this @Szelethus?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75171/new/

https://reviews.llvm.org/D75171

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


[clang] fb321c2 - [OpenCL] Define OpenCL 3.0 optional core features in C++ for OpenCL 2021

2021-09-01 Thread Justas Janickas via cfe-commits

Author: Justas Janickas
Date: 2021-09-01T10:15:17+01:00
New Revision: fb321c2ea274c1bd1e1b294f2c090f1c0d9a97fe

URL: 
https://github.com/llvm/llvm-project/commit/fb321c2ea274c1bd1e1b294f2c090f1c0d9a97fe
DIFF: 
https://github.com/llvm/llvm-project/commit/fb321c2ea274c1bd1e1b294f2c090f1c0d9a97fe.diff

LOG: [OpenCL] Define OpenCL 3.0 optional core features in C++ for OpenCL 2021

Modifies OpenCL 3.0 optional core feature macro definitions so that
they are set analogously in C++ for OpenCL 2021.

This change aims to achieve compatibility between C++ for OpenCL
2021 and OpenCL 3.0.

Differential Revision: https://reviews.llvm.org/D108704

Added: 


Modified: 
clang/lib/Headers/opencl-c-base.h
clang/test/Headers/opencl-c-header.cl
clang/test/SemaOpenCL/features.cl

Removed: 




diff  --git a/clang/lib/Headers/opencl-c-base.h 
b/clang/lib/Headers/opencl-c-base.h
index ff8b776d03bb8..f3605c659d952 100644
--- a/clang/lib/Headers/opencl-c-base.h
+++ b/clang/lib/Headers/opencl-c-base.h
@@ -30,7 +30,7 @@
 #endif // (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
 
 // Define feature macros for OpenCL C 2.0
-#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ == 200)
+#if (__OPENCL_CPP_VERSION__ == 100 || __OPENCL_C_VERSION__ == 200)
 #define __opencl_c_pipes 1
 #define __opencl_c_generic_address_space 1
 #define __opencl_c_work_group_collective_functions 1
@@ -45,12 +45,12 @@
 #endif
 
 // Define header-only feature macros for OpenCL C 3.0.
-#if (__OPENCL_C_VERSION__ == 300)
+#if (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
 // For the SPIR target all features are supported.
 #if defined(__SPIR__)
 #define __opencl_c_atomic_scope_all_devices 1
 #endif // defined(__SPIR__)
-#endif // (__OPENCL_C_VERSION__ == 300)
+#endif // (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
 
 // built-in scalar data types:
 

diff  --git a/clang/test/Headers/opencl-c-header.cl 
b/clang/test/Headers/opencl-c-header.cl
index e7d0ae017d3a7..50b9ebba8f0d2 100644
--- a/clang/test/Headers/opencl-c-header.cl
+++ b/clang/test/Headers/opencl-c-header.cl
@@ -175,13 +175,13 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
 #endif //(defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
 
 // OpenCL C features.
-#if (__OPENCL_C_VERSION__ == 300)
+#if (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
 
 #if __opencl_c_atomic_scope_all_devices != 1
 #error "Incorrectly defined feature macro __opencl_c_atomic_scope_all_devices"
 #endif
 
-#elif (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ == 200)
+#elif (__OPENCL_CPP_VERSION__ == 100 || __OPENCL_C_VERSION__ == 200)
 
 #ifndef  __opencl_c_pipes
 #error "Feature macro __opencl_c_pipes should be defined"
@@ -262,6 +262,6 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
 #error "Incorrect feature macro __opencl_c_subgroups define"
 #endif
 
-#endif //(defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ == 200)
+#endif // (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
 
 #endif // defined(__SPIR__)

diff  --git a/clang/test/SemaOpenCL/features.cl 
b/clang/test/SemaOpenCL/features.cl
index 57c52694b6850..af058b5e69828 100644
--- a/clang/test/SemaOpenCL/features.cl
+++ b/clang/test/SemaOpenCL/features.cl
@@ -6,6 +6,14 @@
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
 // RUN: %clang_cc1 -triple r600-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=CL3.0 -cl-ext=+all \
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=FEATURES
+// RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=clc++2021 -cl-ext=-all \
+// RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
+// RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=clc++2021 -cl-ext=+all \
+// RUN:   | FileCheck -match-full-lines %s  --check-prefix=FEATURES
+// RUN: %clang_cc1 -triple r600-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=clc++2021 \
+// RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
+// RUN: %clang_cc1 -triple r600-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=clc++2021 -cl-ext=+all \
+// RUN:   | FileCheck -match-full-lines %s  --check-prefix=FEATURES
 
 // For OpenCL C 2.0 feature macros are defined only in header, so test that 
earlier OpenCL
 // versions don't define feature macros accidentally and CL2.0 don't define 
them without header
@@ -15,7 +23,7 @@
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
 // RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=CL2.0 \
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
-// RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=CLC++ \
+// RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=clc++1.0 \
 // RUN:   | FileCheck -match-full-lines %s  --check-pre

[PATCH] D108704: [OpenCL] Define OpenCL 3.0 optional core features in C++ for OpenCL 2021

2021-09-01 Thread Justas Janickas via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGfb321c2ea274: [OpenCL] Define OpenCL 3.0 optional core 
features in C++ for OpenCL 2021 (authored by Topotuna).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108704/new/

https://reviews.llvm.org/D108704

Files:
  clang/lib/Headers/opencl-c-base.h
  clang/test/Headers/opencl-c-header.cl
  clang/test/SemaOpenCL/features.cl


Index: clang/test/SemaOpenCL/features.cl
===
--- clang/test/SemaOpenCL/features.cl
+++ clang/test/SemaOpenCL/features.cl
@@ -6,6 +6,14 @@
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
 // RUN: %clang_cc1 -triple r600-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=CL3.0 -cl-ext=+all \
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=FEATURES
+// RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=clc++2021 -cl-ext=-all \
+// RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
+// RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=clc++2021 -cl-ext=+all \
+// RUN:   | FileCheck -match-full-lines %s  --check-prefix=FEATURES
+// RUN: %clang_cc1 -triple r600-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=clc++2021 \
+// RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
+// RUN: %clang_cc1 -triple r600-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=clc++2021 -cl-ext=+all \
+// RUN:   | FileCheck -match-full-lines %s  --check-prefix=FEATURES
 
 // For OpenCL C 2.0 feature macros are defined only in header, so test that 
earlier OpenCL
 // versions don't define feature macros accidentally and CL2.0 don't define 
them without header
@@ -15,7 +23,7 @@
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
 // RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=CL2.0 \
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
-// RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=CLC++ \
+// RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl 
-cl-std=clc++1.0 \
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
 
 // Note that __opencl_c_int64 is always defined assuming
Index: clang/test/Headers/opencl-c-header.cl
===
--- clang/test/Headers/opencl-c-header.cl
+++ clang/test/Headers/opencl-c-header.cl
@@ -175,13 +175,13 @@
 #endif //(defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
 
 // OpenCL C features.
-#if (__OPENCL_C_VERSION__ == 300)
+#if (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
 
 #if __opencl_c_atomic_scope_all_devices != 1
 #error "Incorrectly defined feature macro __opencl_c_atomic_scope_all_devices"
 #endif
 
-#elif (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ == 200)
+#elif (__OPENCL_CPP_VERSION__ == 100 || __OPENCL_C_VERSION__ == 200)
 
 #ifndef  __opencl_c_pipes
 #error "Feature macro __opencl_c_pipes should be defined"
@@ -262,6 +262,6 @@
 #error "Incorrect feature macro __opencl_c_subgroups define"
 #endif
 
-#endif //(defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ == 200)
+#endif // (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
 
 #endif // defined(__SPIR__)
Index: clang/lib/Headers/opencl-c-base.h
===
--- clang/lib/Headers/opencl-c-base.h
+++ clang/lib/Headers/opencl-c-base.h
@@ -30,7 +30,7 @@
 #endif // (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
 
 // Define feature macros for OpenCL C 2.0
-#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ == 200)
+#if (__OPENCL_CPP_VERSION__ == 100 || __OPENCL_C_VERSION__ == 200)
 #define __opencl_c_pipes 1
 #define __opencl_c_generic_address_space 1
 #define __opencl_c_work_group_collective_functions 1
@@ -45,12 +45,12 @@
 #endif
 
 // Define header-only feature macros for OpenCL C 3.0.
-#if (__OPENCL_C_VERSION__ == 300)
+#if (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
 // For the SPIR target all features are supported.
 #if defined(__SPIR__)
 #define __opencl_c_atomic_scope_all_devices 1
 #endif // defined(__SPIR__)
-#endif // (__OPENCL_C_VERSION__ == 300)
+#endif // (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
 
 // built-in scalar data types:
 


Index: clang/test/SemaOpenCL/features.cl
===
--- clang/test/SemaOpenCL/features.cl
+++ clang/test/SemaOpenCL/features.cl
@@ -6,6 +6,14 @@
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=NO-FEATURES
 // RUN: %clang_cc1 -triple r600-unknown-unknown %s -E -dM -o - -x cl -cl-std=CL3.0 -cl-ext=+all \
 // RUN:   | FileCheck -match-full-lines %s  --check-prefix=FEATURES

[PATCH] D108989: [OpenCL] Supports optional 64-bit floating point types in C++ for OpenCL 2021

2021-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.

LGTM! Thanks


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108989/new/

https://reviews.llvm.org/D108989

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


[PATCH] D109002: [OpenCL] Supports optional image types in C++ for OpenCL 2021

2021-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments.



Comment at: clang/lib/Sema/SemaType.cpp:1729
 bool IsOpenCLC30 = (S.getLangOpts().OpenCLVersion == 300);
+bool IsOpenCLC30Comp = S.getLangOpts().getOpenCLCompatibleVersion() == 300;
 // OpenCL C v3.0 s6.3.3 - OpenCL image types require __opencl_c_images

I think we should just replace `IsOpenCLC30` as it is when only used in the 
diagnostic that we should report the same as for OpenCL 3.0.


Also I would suggest changing name to `IsOpenCLC30Compatible` to make it 
clearer. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109002/new/

https://reviews.llvm.org/D109002

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


[PATCH] D109002: [OpenCL] Supports optional image types in C++ for OpenCL 2021

2021-09-01 Thread Justas Janickas via Phabricator via cfe-commits
Topotuna added inline comments.



Comment at: clang/lib/Sema/SemaType.cpp:1729
 bool IsOpenCLC30 = (S.getLangOpts().OpenCLVersion == 300);
+bool IsOpenCLC30Comp = S.getLangOpts().getOpenCLCompatibleVersion() == 300;
 // OpenCL C v3.0 s6.3.3 - OpenCL image types require __opencl_c_images

Anastasia wrote:
> I think we should just replace `IsOpenCLC30` as it is when only used in the 
> diagnostic that we should report the same as for OpenCL 3.0.
> 
> 
> Also I would suggest changing name to `IsOpenCLC30Compatible` to make it 
> clearer. 
That diagnostic is responsible for `__opencl_c_3d_image_writes` feature while 
current commit addresses `__opencl_c_images`. I wanted to keep commits separate 
and was planning to finish transitioning from `IsOpenCLC30` to 
`IsOpenCLC30Compatible` in a future commit.

I agree that `IsOpenCLC30Compatible` would be clearer. Thank you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109002/new/

https://reviews.llvm.org/D109002

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


[PATCH] D109051: Use Component in OpenBSD::getCompilerRT to find libraries

2021-09-01 Thread Greg Steuck via Phabricator via cfe-commits
blackgnezdo created this revision.
blackgnezdo added a reviewer: brad.
Herald added a subscriber: krytarowski.
blackgnezdo requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

OpenBSD with this change would use this name for ASan:
/usr/lib/clang/11.1.0/lib/libclang_rt.asan.a

Already submitted to OpenBSD repository.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109051

Files:
  clang/lib/Driver/ToolChains/OpenBSD.cpp


Index: clang/lib/Driver/ToolChains/OpenBSD.cpp
===
--- clang/lib/Driver/ToolChains/OpenBSD.cpp
+++ clang/lib/Driver/ToolChains/OpenBSD.cpp
@@ -302,9 +302,17 @@
 std::string OpenBSD::getCompilerRT(const ArgList &Args,
StringRef Component,
FileType Type) const {
-  SmallString<128> Path(getDriver().SysRoot);
-  llvm::sys::path::append(Path, "/usr/lib/libcompiler_rt.a");
-  return std::string(Path.str());
+  if (Component == "builtins") {
+SmallString<128> Path(getDriver().SysRoot);
+llvm::sys::path::append(Path, "/usr/lib/libcompiler_rt.a");
+return std::string(Path.str());
+  } else {
+SmallString<128> P(getDriver().ResourceDir);
+std::string CRTBasename =
+getCompilerRTBasename(Args, Component, Type, /*AddArch=*/false);
+llvm::sys::path::append(P, "lib", CRTBasename);
+return std::string(P.str());
+  }
 }
 
 Tool *OpenBSD::buildAssembler() const {


Index: clang/lib/Driver/ToolChains/OpenBSD.cpp
===
--- clang/lib/Driver/ToolChains/OpenBSD.cpp
+++ clang/lib/Driver/ToolChains/OpenBSD.cpp
@@ -302,9 +302,17 @@
 std::string OpenBSD::getCompilerRT(const ArgList &Args,
StringRef Component,
FileType Type) const {
-  SmallString<128> Path(getDriver().SysRoot);
-  llvm::sys::path::append(Path, "/usr/lib/libcompiler_rt.a");
-  return std::string(Path.str());
+  if (Component == "builtins") {
+SmallString<128> Path(getDriver().SysRoot);
+llvm::sys::path::append(Path, "/usr/lib/libcompiler_rt.a");
+return std::string(Path.str());
+  } else {
+SmallString<128> P(getDriver().ResourceDir);
+std::string CRTBasename =
+getCompilerRTBasename(Args, Component, Type, /*AddArch=*/false);
+llvm::sys::path::append(P, "lib", CRTBasename);
+return std::string(P.str());
+  }
 }
 
 Tool *OpenBSD::buildAssembler() const {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] f0514a4 - Reland "[clang-repl] Re-implement clang-interpreter as a test case."

2021-09-01 Thread Vassil Vassilev via cfe-commits

Author: Vassil Vassilev
Date: 2021-09-01T10:21:38Z
New Revision: f0514a4d26100239088f08d618f2ba100f59958e

URL: 
https://github.com/llvm/llvm-project/commit/f0514a4d26100239088f08d618f2ba100f59958e
DIFF: 
https://github.com/llvm/llvm-project/commit/f0514a4d26100239088f08d618f2ba100f59958e.diff

LOG: Reland "[clang-repl] Re-implement clang-interpreter as a test case."

Original commit message:"
  The current infrastructure in lib/Interpreter has a tool, clang-repl, very
  similar to clang-interpreter which also allows incremental compilation.

  This patch moves clang-interpreter as a test case and drops it as 
conditionally
  built example as we already have clang-repl in place.

  Differential revision: https://reviews.llvm.org/D107049
"

This patch also ignores ppc due to missing weak symbol for __gxx_personality_v0
which may be a feature request for the jit infrastructure. Also, adds a missing
build system dependency to the orc jit.

Added: 
clang/unittests/Interpreter/ExceptionTests/CMakeLists.txt
clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp

Modified: 
clang/docs/ClangFormattedStatus.rst
clang/examples/CMakeLists.txt
clang/include/clang/Interpreter/Interpreter.h
clang/lib/Interpreter/IncrementalExecutor.cpp
clang/lib/Interpreter/IncrementalExecutor.h
clang/lib/Interpreter/Interpreter.cpp
clang/test/CMakeLists.txt
clang/test/lit.cfg.py
clang/unittests/Interpreter/CMakeLists.txt
clang/unittests/Interpreter/InterpreterTest.cpp

Removed: 
clang/examples/clang-interpreter/CMakeLists.txt
clang/examples/clang-interpreter/README.txt
clang/examples/clang-interpreter/Test.cxx
clang/test/Misc/interpreter.c



diff  --git a/clang/docs/ClangFormattedStatus.rst 
b/clang/docs/ClangFormattedStatus.rst
index beca555ebc016..77320cd2b6550 100644
--- a/clang/docs/ClangFormattedStatus.rst
+++ b/clang/docs/ClangFormattedStatus.rst
@@ -59,11 +59,6 @@ tree in terms of conformance to :doc:`ClangFormat` as of: 
June 04, 2021 13:01:37
  - `1`
  - `0`
  - :good:`100%`
-   * - clang/examples/clang-interpreter
- - `1`
- - `0`
- - `1`
- - :none:`0%`
* - clang/examples/PrintFunctionNames
  - `1`
  - `0`

diff  --git a/clang/examples/CMakeLists.txt b/clang/examples/CMakeLists.txt
index 300d8d795c674..8a4139f5d8c11 100644
--- a/clang/examples/CMakeLists.txt
+++ b/clang/examples/CMakeLists.txt
@@ -3,7 +3,6 @@ if(NOT CLANG_BUILD_EXAMPLES)
   set(EXCLUDE_FROM_ALL ON)
 endif()
 
-add_subdirectory(clang-interpreter)
 add_subdirectory(PrintFunctionNames)
 add_subdirectory(AnnotateFunctions)
 add_subdirectory(Attribute)

diff  --git a/clang/examples/clang-interpreter/CMakeLists.txt 
b/clang/examples/clang-interpreter/CMakeLists.txt
deleted file mode 100644
index 11056aa379ae8..0
--- a/clang/examples/clang-interpreter/CMakeLists.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-set(LLVM_LINK_COMPONENTS
-  Core
-  ExecutionEngine
-  MC
-  MCJIT
-  Object
-  OrcJit
-  Option
-  RuntimeDyld
-  Support
-  native
-  )
-
-add_clang_executable(clang-interpreter
-  main.cpp
-  )
-
-add_dependencies(clang-interpreter
-  clang-resource-headers
-  )
-
-clang_target_link_libraries(clang-interpreter
-  PRIVATE
-  clangBasic
-  clangCodeGen
-  clangDriver
-  clangFrontend
-  clangSerialization
-  )
-
-export_executable_symbols(clang-interpreter)
-
-if (MSVC)
-  # Is this a CMake bug that even with export_executable_symbols, Windows
-  # needs to explictly export the type_info vtable
-  set_property(TARGET clang-interpreter
-   APPEND_STRING PROPERTY LINK_FLAGS " /EXPORT:??_7type_info@@6B@")
-endif()
-
-function(clang_enable_exceptions TARGET)
-  # Really have to jump through hoops to enable exception handling independent
-  # of how LLVM is being built.
-  if (NOT LLVM_REQUIRES_EH AND NOT LLVM_REQUIRES_RTTI)
-if (MSVC)
-  # /EHs to allow throwing from extern "C"
-  set(excptnExceptions_ON "/D _HAS_EXCEPTIONS=1 /EHs /wd4714")
-  set(excptnExceptions_OFF "/D _HAS_EXCEPTIONS=0 /EHs-c-")
-  set(excptnRTTI_ON "/GR")
-  set(excptnRTTI_OFF "/GR-")
-  set(excptnEHRTTIRegEx "(/EHs(-c-?)|_HAS_EXCEPTIONS=(0|1))")
-else()
-  set(excptnExceptions_ON "-fexceptions")
-  set(excptnExceptions_OFF "-fno-exceptions")
-  set(excptnRTTI_ON "-frtti")
-  set(excptnRTTI_OFF "-fno-rtti")
-  set(excptnEHRTTIRegEx "-f(exceptions|no-exceptions)")
-endif()
-if (LLVM_REQUIRES_EH)
-  set(excptnExceptions_DFLT ${excptnExceptions_ON})
-else()
-  set(excptnExceptions_DFLT ${excptnExceptions_OFF})
-endif()
-if (LLVM_REQUIRES_RTTI)
-  set(excptnRTTI_DFLT ${excptnRTTI_ON})
-else()
-  set(excptnRTTI_DFLT ${excptnRTTI_OFF})
-endif()
-
-# Strip the exception & rtti flags from the target
-get_property(addedFlags TARGET ${TARGET} PROPERTY COMPILE_FLAGS)
-string(REGEX REPLAC

[clang] 83f3782 - [clang-nvlink-wrapper] Wrapper around nvlink for archive files

2021-09-01 Thread Saiyedul Islam via cfe-commits

Author: Saiyedul Islam
Date: 2021-09-01T16:00:29+05:30
New Revision: 83f3782c6129e7a5df3faaf0ae576611d16a8d49

URL: 
https://github.com/llvm/llvm-project/commit/83f3782c6129e7a5df3faaf0ae576611d16a8d49
DIFF: 
https://github.com/llvm/llvm-project/commit/83f3782c6129e7a5df3faaf0ae576611d16a8d49.diff

LOG: [clang-nvlink-wrapper] Wrapper around nvlink for archive files

 nvlink does not support linking of cubin files archived in an archive.
 This tool extracts all the cubin files in the given device specific archive
 and pass them to nvlink. It is required for linking static device libraries
 for nvptx.

 Reviewed By: ye-luo

 Differential Revision: https://reviews.llvm.org/D108291

Added: 
clang/tools/clang-nvlink-wrapper/CMakeLists.txt
clang/tools/clang-nvlink-wrapper/ClangNvlinkWrapper.cpp

Modified: 
clang/tools/CMakeLists.txt

Removed: 




diff  --git a/clang/tools/CMakeLists.txt b/clang/tools/CMakeLists.txt
index c929f6e665e2c..38b7496b97f72 100644
--- a/clang/tools/CMakeLists.txt
+++ b/clang/tools/CMakeLists.txt
@@ -8,6 +8,7 @@ add_clang_subdirectory(clang-format)
 add_clang_subdirectory(clang-format-vs)
 add_clang_subdirectory(clang-fuzzer)
 add_clang_subdirectory(clang-import-test)
+add_clang_subdirectory(clang-nvlink-wrapper)
 add_clang_subdirectory(clang-offload-bundler)
 add_clang_subdirectory(clang-offload-wrapper)
 add_clang_subdirectory(clang-scan-deps)

diff  --git a/clang/tools/clang-nvlink-wrapper/CMakeLists.txt 
b/clang/tools/clang-nvlink-wrapper/CMakeLists.txt
new file mode 100644
index 0..033392f1c2bdc
--- /dev/null
+++ b/clang/tools/clang-nvlink-wrapper/CMakeLists.txt
@@ -0,0 +1,25 @@
+set(LLVM_LINK_COMPONENTS BitWriter Core Object Support)
+
+if(NOT CLANG_BUILT_STANDALONE)
+  set(tablegen_deps intrinsics_gen)
+endif()
+
+add_clang_executable(clang-nvlink-wrapper
+  ClangNvlinkWrapper.cpp
+
+  DEPENDS
+  ${tablegen_deps}
+  )
+
+set(CLANG_NVLINK_WRAPPER_LIB_DEPS
+  clangBasic
+  )
+
+add_dependencies(clang clang-nvlink-wrapper)
+
+target_link_libraries(clang-nvlink-wrapper
+  PRIVATE
+  ${CLANG_NVLINK_WRAPPER_LIB_DEPS}
+  )
+
+install(TARGETS clang-nvlink-wrapper RUNTIME DESTINATION bin)

diff  --git a/clang/tools/clang-nvlink-wrapper/ClangNvlinkWrapper.cpp 
b/clang/tools/clang-nvlink-wrapper/ClangNvlinkWrapper.cpp
new file mode 100644
index 0..00c371e35e75c
--- /dev/null
+++ b/clang/tools/clang-nvlink-wrapper/ClangNvlinkWrapper.cpp
@@ -0,0 +1,164 @@
+//===-- clang-nvlink-wrapper/ClangNvlinkWrapper.cpp - wrapper over nvlink-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===-===//
+///
+/// \file
+/// This tool works as a wrapper over nvlink program. It transparently passes
+/// every input option and objects to nvlink except archive files. It reads
+/// each input archive file to extract archived cubin files as temporary files.
+/// These temp (*.cubin) files are passed to nvlink, because nvlink does not
+/// support linking of archive files implicitly.
+///
+/// During linking of heteregenous device archive libraries, the
+/// clang-offload-bundler creates a device specific archive of cubin files.
+/// Such an archive is then passed to this tool to extract cubin files before
+/// passing to nvlink.
+///
+/// Example:
+/// clang-nvlink-wrapper -o a.out-openmp-nvptx64 /tmp/libTest-nvptx-sm_50.a
+///
+/// 1. Extract (libTest-nvptx-sm_50.a) => /tmp/a.cubin /tmp/b.cubin
+/// 2. nvlink -o a.out-openmp-nvptx64 /tmp/a.cubin /tmp/b.cubin
+//===-===//
+
+#include "llvm/Object/Archive.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Errc.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/Path.h"
+#include "llvm/Support/Program.h"
+#include "llvm/Support/Signals.h"
+#include "llvm/Support/StringSaver.h"
+#include "llvm/Support/WithColor.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm;
+
+static cl::opt Help("h", cl::desc("Alias for -help"), cl::Hidden);
+
+static Error runNVLink(std::string NVLinkPath,
+   SmallVectorImpl &Args) {
+  std::vector NVLArgs;
+  NVLArgs.push_back(NVLinkPath);
+  for (auto &Arg : Args) {
+NVLArgs.push_back(Arg);
+  }
+
+  if (sys::ExecuteAndWait(NVLinkPath.c_str(), NVLArgs))
+return createStringError(inconvertibleErrorCode(), "'nvlink' failed");
+  return Error::success();
+}
+
+static Error extractArchiveFiles(StringRef Filename,
+ SmallVectorImpl &Args,
+ SmallVectorImpl &TmpFiles) {
+  std::vector> ArchiveBuffers;
+
+  ErrorOr> BufOrErr =
+  MemoryBuffer::getFile

[PATCH] D108912: [release][analyzer] Add 13.0.0 release notes

2021-09-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment.

Here is one more related to HTML diagnostics:
rG9e02f58780ab8734e5d27a0138bd477d18ae64a1 
 
//Highlight arrows for currently selected event//


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108912/new/

https://reviews.llvm.org/D108912

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


[PATCH] D109051: Use Component in OpenBSD::getCompilerRT to find libraries

2021-09-01 Thread Greg Steuck via Phabricator via cfe-commits
blackgnezdo added a comment.

OpenBSD commit: 
https://github.com/openbsd/src/commit/0b99cc4d5d8311a90145e8f4c6ae23275c275c52


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109051/new/

https://reviews.llvm.org/D109051

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


[PATCH] D106262: [clang][analyzer] Use generic note tag in alpha.unix.Stream .

2021-09-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment.

I like that! Though for now, any tests that displays how these notes can emit 
different messages for different `BugType`s will suffice, so we can bypass 
other design discussions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106262/new/

https://reviews.llvm.org/D106262

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


[clang] cec7c2b - Revert "[CLANG][PATCH][FPEnv] Add support for option -ffp-eval-method and extend #pragma float_control similarly"

2021-09-01 Thread Zahira Ammarguellat via cfe-commits

Author: Zahira Ammarguellat
Date: 2021-09-01T04:48:50-07:00
New Revision: cec7c2b32ecfd38151822a6e01ec78afaf98bf9a

URL: 
https://github.com/llvm/llvm-project/commit/cec7c2b32ecfd38151822a6e01ec78afaf98bf9a
DIFF: 
https://github.com/llvm/llvm-project/commit/cec7c2b32ecfd38151822a6e01ec78afaf98bf9a.diff

LOG: Revert "[CLANG][PATCH][FPEnv] Add support for option -ffp-eval-method and 
extend #pragma float_control similarly"
The intent of this patch is to add support of 
-fp-model=[source|double|extended] to allow
the compiler to use a wider type for intermediate floating point calculations. 
As a side
effect to that, the value of FLT_EVAL_METHOD is changed according to the pragma
float_control.
Unfortunately some issue was uncovered with this change in preprocessing. See 
details in
https://reviews.llvm.org/D93769 . We are therefore reverting this patch until 
we find a way
to reconcile the value of FLT_EVAL_METHOD, the pragma and the -E flow.

This reverts commit 66ddac22e2a7f268e91c26d694112970dfa607ae.

Added: 


Modified: 
clang/docs/LanguageExtensions.rst
clang/docs/UsersManual.rst
clang/include/clang/Basic/FPOptions.def
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Basic/LangOptions.h
clang/include/clang/Basic/PragmaKinds.h
clang/include/clang/Basic/TargetInfo.h
clang/include/clang/Driver/Options.td
clang/include/clang/Lex/Preprocessor.h
clang/include/clang/Lex/PreprocessorOptions.h
clang/include/clang/Sema/Sema.h
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Basic/Targets/X86.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Frontend/InitPreprocessor.cpp
clang/lib/Lex/PPMacroExpansion.cpp
clang/lib/Parse/ParsePragma.cpp
clang/lib/Sema/Sema.cpp
clang/lib/Sema/SemaAttr.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/CodeGen/fp-floatcontrol-pragma.cpp
clang/test/Preprocessor/init-aarch64.c
clang/test/Preprocessor/init-arm.c
clang/test/Preprocessor/init-mips.c
clang/test/Preprocessor/init-ppc.c
clang/test/Preprocessor/init-ppc64.c
clang/test/Preprocessor/init-s390x.c
clang/test/Preprocessor/init-v7k-compat.c
clang/test/Preprocessor/init-x86.c
clang/test/Preprocessor/init.c

Removed: 




diff  --git a/clang/docs/LanguageExtensions.rst 
b/clang/docs/LanguageExtensions.rst
index 3193c8cdc11e..28791a48a6c0 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -3579,7 +3579,7 @@ specification, a stack is supported so that the ``pragma 
float_control``
 settings can be pushed or popped.
 
 When ``pragma float_control(precise, on)`` is enabled, the section of code
-governed by the pragma uses precise floating-point semantics, effectively
+governed by the pragma uses precise floating point semantics, effectively
 ``-ffast-math`` is disabled and ``-ffp-contract=on``
 (fused multiply add) is enabled.
 
@@ -3590,29 +3590,8 @@ when ``pragma float_control(precise, off)`` is enabled, 
the section of code
 governed by the pragma behaves as though the command-line option
 ``-ffp-exception-behavior=ignore`` is enabled.
 
-When ``pragma float_control(source, on)`` is enabled, the section of code 
governed
-by the pragma behaves as though the command-line option
-``-ffp-eval-method=source`` is enabled. Note: The default
-floating-point evaluation method is target-specific, typically ``source``.
-
-When ``pragma float_control(double, on)`` is enabled, the section of code 
governed
-by the pragma behaves as though the command-line option
-``-ffp-eval-method=double`` is enabled.
-
-When ``pragma float_control(extended, on)`` is enabled, the section of code 
governed
-by the pragma behaves as though the command-line option
-``-ffp-eval-method=extended`` is enabled.
-
-When ``pragma float_control(source, off)`` or
-``pragma float_control(double, off)`` or
-``pragma float_control(extended, off)`` is enabled,
-the section of code governed
-by the pragma behaves as though the command-line option
-``-ffp-eval-method=source`` is enabled, returning floating-point evaluation
-method to the default setting.
-
 The full syntax this pragma supports is
-``float_control(except|precise|source|double|extended, on|off [, push])`` and
+``float_control(except|precise, on|off [, push])`` and
 ``float_control(push|pop)``.
 The ``push`` and ``pop`` forms, including using ``push`` as the optional
 third argument, can only occur at file scope.

diff  --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index f8a2f39f6522..f025028c1721 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -1478,17 +1478,6 @@ Note that floating-point operations performed as part of 
constant initialization
* ``maytrap`` The compiler avoids transformations that may raise exceptions 
that would not have been raised by the original code. C

[PATCH] D109003: Ensure field-annotations on pointers properly match the AS of the field.

2021-09-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM!




Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:2408
   llvm::Type *VTy = V->getType();
-  llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::ptr_annotation,
-CGM.Int8PtrTy);
+  llvm::PointerType *PTy = dyn_cast(VTy);
+  unsigned AS = PTy ? PTy->getAddressSpace() : 0;




Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109003/new/

https://reviews.llvm.org/D109003

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


[PATCH] D107049: [clang-repl] Re-implement clang-interpreter as a test case.

2021-09-01 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment.
Herald added a subscriber: ormris.

The test fails for me on macOS (normal cmake build):

  % 
tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
  [==] Running 1 test from 1 test suite.
  [--] Global test environment set-up.
  [--] 1 test from InterpreterTest
  [ RUN  ] InterpreterTest.CatchException
  In file included from <<< inputs >>>:1:
  input_line_0:2:10: fatal error: 'stdexcept' file not found
  #include 
   ^~~

The reason is probably that C++ stdlib headers are part of the toolchain, not 
the sysroot, on macOS. So self-built clang can't include libc++(abi) headers 
without some hoops.

Tests should generally be standalone though anyways. Can we remove these 
includes and just throw some basic type?

Finally, hardcoding the path between unit test binary and the rest of the build 
dir is fairly unusual. Can't this be a lit-style test that uses the normal 
substitution logic we use in lit?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107049/new/

https://reviews.llvm.org/D107049

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


[PATCH] D107049: [clang-repl] Re-implement clang-interpreter as a test case.

2021-09-01 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment.

Also failing on the bots: 
https://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/23343/execution/node/39/log/
 (that's for the original land, but from what I can tell nothing has changed in 
this regard for the reland, and I'm still seeing the same failure at head).

I'll revert this for now to unbreak mac bots.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107049/new/

https://reviews.llvm.org/D107049

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


[clang] 9b6c813 - Revert "Reland "[clang-repl] Re-implement clang-interpreter as a test case.""

2021-09-01 Thread Nico Weber via cfe-commits

Author: Nico Weber
Date: 2021-09-01T08:35:33-04:00
New Revision: 9b6c8132d3785269512803ff51cb421f8d8bcf0e

URL: 
https://github.com/llvm/llvm-project/commit/9b6c8132d3785269512803ff51cb421f8d8bcf0e
DIFF: 
https://github.com/llvm/llvm-project/commit/9b6c8132d3785269512803ff51cb421f8d8bcf0e.diff

LOG: Revert "Reland "[clang-repl] Re-implement clang-interpreter as a test 
case.""

This reverts commit f0514a4d26100239088f08d618f2ba100f59958e.
Test fails on macOS: https://reviews.llvm.org/D107049#2976603

Added: 
clang/examples/clang-interpreter/CMakeLists.txt
clang/examples/clang-interpreter/README.txt
clang/examples/clang-interpreter/Test.cxx
clang/test/Misc/interpreter.c

Modified: 
clang/docs/ClangFormattedStatus.rst
clang/examples/CMakeLists.txt
clang/include/clang/Interpreter/Interpreter.h
clang/lib/Interpreter/IncrementalExecutor.cpp
clang/lib/Interpreter/IncrementalExecutor.h
clang/lib/Interpreter/Interpreter.cpp
clang/test/CMakeLists.txt
clang/test/lit.cfg.py
clang/unittests/Interpreter/CMakeLists.txt
clang/unittests/Interpreter/InterpreterTest.cpp

Removed: 
clang/unittests/Interpreter/ExceptionTests/CMakeLists.txt
clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp



diff  --git a/clang/docs/ClangFormattedStatus.rst 
b/clang/docs/ClangFormattedStatus.rst
index 77320cd2b6550..beca555ebc016 100644
--- a/clang/docs/ClangFormattedStatus.rst
+++ b/clang/docs/ClangFormattedStatus.rst
@@ -59,6 +59,11 @@ tree in terms of conformance to :doc:`ClangFormat` as of: 
June 04, 2021 13:01:37
  - `1`
  - `0`
  - :good:`100%`
+   * - clang/examples/clang-interpreter
+ - `1`
+ - `0`
+ - `1`
+ - :none:`0%`
* - clang/examples/PrintFunctionNames
  - `1`
  - `0`

diff  --git a/clang/examples/CMakeLists.txt b/clang/examples/CMakeLists.txt
index 8a4139f5d8c11..300d8d795c674 100644
--- a/clang/examples/CMakeLists.txt
+++ b/clang/examples/CMakeLists.txt
@@ -3,6 +3,7 @@ if(NOT CLANG_BUILD_EXAMPLES)
   set(EXCLUDE_FROM_ALL ON)
 endif()
 
+add_subdirectory(clang-interpreter)
 add_subdirectory(PrintFunctionNames)
 add_subdirectory(AnnotateFunctions)
 add_subdirectory(Attribute)

diff  --git a/clang/examples/clang-interpreter/CMakeLists.txt 
b/clang/examples/clang-interpreter/CMakeLists.txt
new file mode 100644
index 0..11056aa379ae8
--- /dev/null
+++ b/clang/examples/clang-interpreter/CMakeLists.txt
@@ -0,0 +1,93 @@
+set(LLVM_LINK_COMPONENTS
+  Core
+  ExecutionEngine
+  MC
+  MCJIT
+  Object
+  OrcJit
+  Option
+  RuntimeDyld
+  Support
+  native
+  )
+
+add_clang_executable(clang-interpreter
+  main.cpp
+  )
+
+add_dependencies(clang-interpreter
+  clang-resource-headers
+  )
+
+clang_target_link_libraries(clang-interpreter
+  PRIVATE
+  clangBasic
+  clangCodeGen
+  clangDriver
+  clangFrontend
+  clangSerialization
+  )
+
+export_executable_symbols(clang-interpreter)
+
+if (MSVC)
+  # Is this a CMake bug that even with export_executable_symbols, Windows
+  # needs to explictly export the type_info vtable
+  set_property(TARGET clang-interpreter
+   APPEND_STRING PROPERTY LINK_FLAGS " /EXPORT:??_7type_info@@6B@")
+endif()
+
+function(clang_enable_exceptions TARGET)
+  # Really have to jump through hoops to enable exception handling independent
+  # of how LLVM is being built.
+  if (NOT LLVM_REQUIRES_EH AND NOT LLVM_REQUIRES_RTTI)
+if (MSVC)
+  # /EHs to allow throwing from extern "C"
+  set(excptnExceptions_ON "/D _HAS_EXCEPTIONS=1 /EHs /wd4714")
+  set(excptnExceptions_OFF "/D _HAS_EXCEPTIONS=0 /EHs-c-")
+  set(excptnRTTI_ON "/GR")
+  set(excptnRTTI_OFF "/GR-")
+  set(excptnEHRTTIRegEx "(/EHs(-c-?)|_HAS_EXCEPTIONS=(0|1))")
+else()
+  set(excptnExceptions_ON "-fexceptions")
+  set(excptnExceptions_OFF "-fno-exceptions")
+  set(excptnRTTI_ON "-frtti")
+  set(excptnRTTI_OFF "-fno-rtti")
+  set(excptnEHRTTIRegEx "-f(exceptions|no-exceptions)")
+endif()
+if (LLVM_REQUIRES_EH)
+  set(excptnExceptions_DFLT ${excptnExceptions_ON})
+else()
+  set(excptnExceptions_DFLT ${excptnExceptions_OFF})
+endif()
+if (LLVM_REQUIRES_RTTI)
+  set(excptnRTTI_DFLT ${excptnRTTI_ON})
+else()
+  set(excptnRTTI_DFLT ${excptnRTTI_OFF})
+endif()
+
+# Strip the exception & rtti flags from the target
+get_property(addedFlags TARGET ${TARGET} PROPERTY COMPILE_FLAGS)
+string(REGEX REPLACE ${excptnEHRTTIRegEx} "" editedFlags "${addedFlags}")
+string(REPLACE ${excptnRTTI_OFF} "" editedFlags "${editedFlags}")
+set_property(TARGET ${TARGET} PROPERTY COMPILE_FLAGS "${editedFlags}")
+
+get_property(addedFlags TARGET ${TARGET} PROPERTY COMPILE_DEFINITIONS)
+string(REGEX REPLACE ${excptnEHRTTIRegEx} "" editedFlags "${addedFlags}")
+string(REPLACE ${excptnRTTI_OFF} "" editedFlags "${editedFlags}")
+set_property(T

[PATCH] D107049: [clang-repl] Re-implement clang-interpreter as a test case.

2021-09-01 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment.

In D107049#2976603 , @thakis wrote:

> The test fails for me on macOS (normal cmake build):
>
>   % 
> tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
>   [==] Running 1 test from 1 test suite.
>   [--] Global test environment set-up.
>   [--] 1 test from InterpreterTest
>   [ RUN  ] InterpreterTest.CatchException
>   In file included from <<< inputs >>>:1:
>   input_line_0:2:10: fatal error: 'stdexcept' file not found
>   #include 
>^~~
>
> The reason is probably that C++ stdlib headers are part of the toolchain, not 
> the sysroot, on macOS. So self-built clang can't include libc++(abi) headers 
> without some hoops.
>
> Tests should generally be standalone though anyways. Can we remove these 
> includes and just throw some basic type?

Good point. I think I can avoid including stdexcept.

> Finally, hardcoding the path between unit test binary and the rest of the 
> build dir is fairly unusual. Can't this be a lit-style test that uses the 
> normal substitution logic we use in lit?

I did not find a good way to 'find back' the clang resource-dir and it seems to 
be put in a constant place. The test needs to have a compiled and interpreted 
parts -- it throws an exception from the interpreter land and expects a 
compiled binary to be able to catch it. I am not sure if I know how to do that 
in lit.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107049/new/

https://reviews.llvm.org/D107049

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


[PATCH] D107049: [clang-repl] Re-implement clang-interpreter as a test case.

2021-09-01 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment.

> I did not find a good way to 'find back' the clang resource-dir and it seems 
> to be put in a constant place. The test needs to have a compiled and 
> interpreted parts -- it throws an exception from the interpreter land and 
> expects a compiled binary to be able to catch it. I am not sure if I know how 
> to do that in lit.

Maybe this could be a binary with a main() function instead of a unit test, and 
you pass the path to the resource dir and to clang-interpreter to it, and then 
that sets up an exception handler and execs clang-interpreter? Or it could stay 
mostly as-is except make it a binary instead of a test, and call it from lit 
from a `.test` file (and pass in resource dir). That'd be more in line what 
other clang tests do.

(See e.g. the `%resource_dir` substitution, set in 
llvm/utils/lit/lit/llvm/config.py, used in a few places.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107049/new/

https://reviews.llvm.org/D107049

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


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield created this revision.
JonChesterfield added reviewers: tianshilei1992, grokos, jdoerfert.
Herald added subscribers: guansong, yaxunl.
JonChesterfield requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

The commandline flag to specify a particular openmp devicertl library
currently errors like:
fatal error: cannot open file

  './runtimes/runtimes-bins/openmp/libomptarget':
  Is a directory

CommonArgs successfully appends the directory to the commandline args then
mlink-builtin-bitcode rejects it.

This patch is a point fix to that. If --libomptarget-amdgcn-bc-path=directory
then append the expected name for the current architecture and go on as before.
This is useful for test runners that don't hardcode the architecture.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109057

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp


Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1709,22 +1709,26 @@
 : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
+  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
+
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
-std::string LibOmpTargetName(A->getValue());
-if (llvm::sys::fs::exists(LibOmpTargetName)) {
+SmallString<128> LibOmpTargetFile(A->getValue());
+if (llvm::sys::fs::exists(LibOmpTargetFile) &&
+llvm::sys::fs::is_directory(LibOmpTargetFile)) {
+  llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
+}
+
+if (llvm::sys::fs::exists(LibOmpTargetFile)) {
   CC1Args.push_back("-mlink-builtin-bitcode");
-  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
+  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
 } else {
   D.Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
-  << LibOmpTargetName;
+  << LibOmpTargetFile;
 }
   } else {
 bool FoundBCLibrary = false;
 
-std::string LibOmpTargetName =
-"libomptarget-" + BitcodeSuffix.str() + ".bc";
-
 for (StringRef LibraryPath : LibraryPaths) {
   SmallString<128> LibOmpTargetFile(LibraryPath);
   llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);


Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1709,22 +1709,26 @@
 : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
+  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
+
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
-std::string LibOmpTargetName(A->getValue());
-if (llvm::sys::fs::exists(LibOmpTargetName)) {
+SmallString<128> LibOmpTargetFile(A->getValue());
+if (llvm::sys::fs::exists(LibOmpTargetFile) &&
+llvm::sys::fs::is_directory(LibOmpTargetFile)) {
+  llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
+}
+
+if (llvm::sys::fs::exists(LibOmpTargetFile)) {
   CC1Args.push_back("-mlink-builtin-bitcode");
-  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
+  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
 } else {
   D.Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
-  << LibOmpTargetName;
+  << LibOmpTargetFile;
 }
   } else {
 bool FoundBCLibrary = false;
 
-std::string LibOmpTargetName =
-"libomptarget-" + BitcodeSuffix.str() + ".bc";
-
 for (StringRef LibraryPath : LibraryPaths) {
   SmallString<128> LibOmpTargetFile(LibraryPath);
   llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 42ae7eb - Ensure field-annotations on pointers properly match the AS of the field.

2021-09-01 Thread Erich Keane via cfe-commits

Author: Erich Keane
Date: 2021-09-01T06:12:24-07:00
New Revision: 42ae7eb581ff6abf77524f4c9e4333262c95aa4b

URL: 
https://github.com/llvm/llvm-project/commit/42ae7eb581ff6abf77524f4c9e4333262c95aa4b
DIFF: 
https://github.com/llvm/llvm-project/commit/42ae7eb581ff6abf77524f4c9e4333262c95aa4b.diff

LOG: Ensure field-annotations on pointers properly match the AS of the field.

Discovered in SYCL, the field annotations were always cast to an i8*,
which is an invalid bitcast for a pointer type with an address space.
This patch makes sure that we create an intrinsic that takes a pointer
to the correct address-space and properly do our casts.

Differential Revision: https://reviews.llvm.org/D109003

Added: 
clang/test/CodeGenSYCL/field-annotate-addr-space.cpp

Modified: 
clang/lib/CodeGen/CodeGenFunction.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CodeGenFunction.cpp 
b/clang/lib/CodeGen/CodeGenFunction.cpp
index a3c348051c675..5f63461aea96b 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -2405,15 +2405,19 @@ Address CodeGenFunction::EmitFieldAnnotations(const 
FieldDecl *D,
   assert(D->hasAttr() && "no annotate attribute");
   llvm::Value *V = Addr.getPointer();
   llvm::Type *VTy = V->getType();
-  llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::ptr_annotation,
-CGM.Int8PtrTy);
+  auto *PTy = dyn_cast(VTy);
+  unsigned AS = PTy ? PTy->getAddressSpace() : 0;
+  llvm::PointerType *IntrinTy =
+  llvm::PointerType::getWithSamePointeeType(CGM.Int8PtrTy, AS);
+  llvm::Function *F =
+  CGM.getIntrinsic(llvm::Intrinsic::ptr_annotation, IntrinTy);
 
   for (const auto *I : D->specific_attrs()) {
 // FIXME Always emit the cast inst so we can 
diff erentiate between
 // annotation on the first field of a struct and annotation on the struct
 // itself.
-if (VTy != CGM.Int8PtrTy)
-  V = Builder.CreateBitCast(V, CGM.Int8PtrTy);
+if (VTy != IntrinTy)
+  V = Builder.CreateBitCast(V, IntrinTy);
 V = EmitAnnotationCall(F, V, I->getAnnotation(), D->getLocation(), I);
 V = Builder.CreateBitCast(V, VTy);
   }

diff  --git a/clang/test/CodeGenSYCL/field-annotate-addr-space.cpp 
b/clang/test/CodeGenSYCL/field-annotate-addr-space.cpp
new file mode 100644
index 0..86d6f9a8a9e32
--- /dev/null
+++ b/clang/test/CodeGenSYCL/field-annotate-addr-space.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple spir64 -fsycl-is-device -disable-llvm-passes 
-emit-llvm %s -o - | FileCheck %s
+
+// CHECK: [[ANNOT:.+]] = private unnamed_addr constant 
{{.*}}c"my_annotation\00"
+
+struct HasField {
+  // This caused an assertion on creating a bitcast here,
+  // since the address space didn't match.
+  [[clang::annotate("my_annotation")]]
+  int *a;
+};
+
+void foo(int *b) {
+  struct HasField f;
+  // CHECK: %[[A:.+]] = getelementptr inbounds %struct.HasField, 
%struct.HasField addrspace(4)* %{{.+}}
+  // CHECK: %[[BITCAST:.+]] = bitcast i32 addrspace(4)* addrspace(4)* %[[A]] 
to i8 addrspace(4)*
+  // CHECK: %[[CALL:.+]] = call i8 addrspace(4)* @llvm.ptr.annotation.p4i8(i8 
addrspace(4)* %[[BITCAST]], i8* getelementptr inbounds ([14 x i8], [14 x i8]* 
[[ANNOT]]
+  // CHECK: bitcast i8 addrspace(4)* %[[CALL]] to i32 addrspace(4)* 
addrspace(4)*
+  f.a = b;
+}



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


[PATCH] D109003: Ensure field-annotations on pointers properly match the AS of the field.

2021-09-01 Thread Erich Keane via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG42ae7eb581ff: Ensure field-annotations on pointers properly 
match the AS of the field. (authored by erichkeane).
Herald added a project: clang.

Changed prior to commit:
  https://reviews.llvm.org/D109003?vs=369726&id=369914#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109003/new/

https://reviews.llvm.org/D109003

Files:
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/test/CodeGenSYCL/field-annotate-addr-space.cpp


Index: clang/test/CodeGenSYCL/field-annotate-addr-space.cpp
===
--- /dev/null
+++ clang/test/CodeGenSYCL/field-annotate-addr-space.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple spir64 -fsycl-is-device -disable-llvm-passes 
-emit-llvm %s -o - | FileCheck %s
+
+// CHECK: [[ANNOT:.+]] = private unnamed_addr constant 
{{.*}}c"my_annotation\00"
+
+struct HasField {
+  // This caused an assertion on creating a bitcast here,
+  // since the address space didn't match.
+  [[clang::annotate("my_annotation")]]
+  int *a;
+};
+
+void foo(int *b) {
+  struct HasField f;
+  // CHECK: %[[A:.+]] = getelementptr inbounds %struct.HasField, 
%struct.HasField addrspace(4)* %{{.+}}
+  // CHECK: %[[BITCAST:.+]] = bitcast i32 addrspace(4)* addrspace(4)* %[[A]] 
to i8 addrspace(4)*
+  // CHECK: %[[CALL:.+]] = call i8 addrspace(4)* @llvm.ptr.annotation.p4i8(i8 
addrspace(4)* %[[BITCAST]], i8* getelementptr inbounds ([14 x i8], [14 x i8]* 
[[ANNOT]]
+  // CHECK: bitcast i8 addrspace(4)* %[[CALL]] to i32 addrspace(4)* 
addrspace(4)*
+  f.a = b;
+}
Index: clang/lib/CodeGen/CodeGenFunction.cpp
===
--- clang/lib/CodeGen/CodeGenFunction.cpp
+++ clang/lib/CodeGen/CodeGenFunction.cpp
@@ -2405,15 +2405,19 @@
   assert(D->hasAttr() && "no annotate attribute");
   llvm::Value *V = Addr.getPointer();
   llvm::Type *VTy = V->getType();
-  llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::ptr_annotation,
-CGM.Int8PtrTy);
+  auto *PTy = dyn_cast(VTy);
+  unsigned AS = PTy ? PTy->getAddressSpace() : 0;
+  llvm::PointerType *IntrinTy =
+  llvm::PointerType::getWithSamePointeeType(CGM.Int8PtrTy, AS);
+  llvm::Function *F =
+  CGM.getIntrinsic(llvm::Intrinsic::ptr_annotation, IntrinTy);
 
   for (const auto *I : D->specific_attrs()) {
 // FIXME Always emit the cast inst so we can differentiate between
 // annotation on the first field of a struct and annotation on the struct
 // itself.
-if (VTy != CGM.Int8PtrTy)
-  V = Builder.CreateBitCast(V, CGM.Int8PtrTy);
+if (VTy != IntrinTy)
+  V = Builder.CreateBitCast(V, IntrinTy);
 V = EmitAnnotationCall(F, V, I->getAnnotation(), D->getLocation(), I);
 V = Builder.CreateBitCast(V, VTy);
   }


Index: clang/test/CodeGenSYCL/field-annotate-addr-space.cpp
===
--- /dev/null
+++ clang/test/CodeGenSYCL/field-annotate-addr-space.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple spir64 -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
+
+// CHECK: [[ANNOT:.+]] = private unnamed_addr constant {{.*}}c"my_annotation\00"
+
+struct HasField {
+  // This caused an assertion on creating a bitcast here,
+  // since the address space didn't match.
+  [[clang::annotate("my_annotation")]]
+  int *a;
+};
+
+void foo(int *b) {
+  struct HasField f;
+  // CHECK: %[[A:.+]] = getelementptr inbounds %struct.HasField, %struct.HasField addrspace(4)* %{{.+}}
+  // CHECK: %[[BITCAST:.+]] = bitcast i32 addrspace(4)* addrspace(4)* %[[A]] to i8 addrspace(4)*
+  // CHECK: %[[CALL:.+]] = call i8 addrspace(4)* @llvm.ptr.annotation.p4i8(i8 addrspace(4)* %[[BITCAST]], i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[ANNOT]]
+  // CHECK: bitcast i8 addrspace(4)* %[[CALL]] to i32 addrspace(4)* addrspace(4)*
+  f.a = b;
+}
Index: clang/lib/CodeGen/CodeGenFunction.cpp
===
--- clang/lib/CodeGen/CodeGenFunction.cpp
+++ clang/lib/CodeGen/CodeGenFunction.cpp
@@ -2405,15 +2405,19 @@
   assert(D->hasAttr() && "no annotate attribute");
   llvm::Value *V = Addr.getPointer();
   llvm::Type *VTy = V->getType();
-  llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::ptr_annotation,
-CGM.Int8PtrTy);
+  auto *PTy = dyn_cast(VTy);
+  unsigned AS = PTy ? PTy->getAddressSpace() : 0;
+  llvm::PointerType *IntrinTy =
+  llvm::PointerType::getWithSamePointeeType(CGM.Int8PtrTy, AS);
+  llvm::Function *F =
+  CGM.getIntrinsic(llvm::Intrinsic::ptr_annotation, IntrinTy);
 
   for (const auto *I : D->specific_attrs()) {
 // FIXME Always emit the cast inst so we can differentiate between
 // annotation on the first field of a struct and annotation on the struct
 // itself.
-if (VTy != CGM.Int

[PATCH] D107589: [CMake] Support setting default fused FP contract via CMake

2021-09-01 Thread Hans Wennborg via Phabricator via cfe-commits
hans added a comment.

I just got back from vacation, so am probably missing some of the discussion 
elsewhere, but I'm a bit skeptical of this patch. It seems it would be 
confusing for users if clang generates code with different floating-point 
behaviour depending on how it was built.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107589/new/

https://reviews.llvm.org/D107589

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


[PATCH] D108461: [OpenCL] Supports optional generic address space sematics in C++ for OpenCL 2021

2021-09-01 Thread Justas Janickas via Phabricator via cfe-commits
Topotuna updated this revision to Diff 369913.
Topotuna retitled this revision from "[OpenCL] Supports optional generic 
address space in C++ for OpenCL 2021" to "[OpenCL] Supports optional generic 
address space sematics in C++ for OpenCL 2021".
Topotuna edited the summary of this revision.
Topotuna added a comment.

The previously suggested change was split into intermediate steps:
reviews.llvm.org/rGf9bc1b3bee55 
 - 
introduced a mapping function for C++ for OpenCL version compatibility with 
OpenCL and modified condition for setting `OpenCLGenericAddressSpace` language 
option.
reviews.llvm.org/rGfb321c2ea274 
 - enabled 
all OpenCL 3.0 optional core feature macros without implementing their support 
in C++ for OpenCL 2021.

This change only enables semantics for optional generic address space although 
actual functionality is not yet implemented in C++ for OpenCL 2021.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108461/new/

https://reviews.llvm.org/D108461

Files:
  clang/lib/Basic/TargetInfo.cpp
  clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
  clang/test/SemaOpenCL/address-spaces.cl


Index: clang/test/SemaOpenCL/address-spaces.cl
===
--- clang/test/SemaOpenCL/address-spaces.cl
+++ clang/test/SemaOpenCL/address-spaces.cl
@@ -1,7 +1,8 @@
 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
 // RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only
 // RUN: %clang_cc1 %s -cl-std=CL3.0 -cl-ext=+__opencl_c_generic_address_space 
-verify -pedantic -fsyntax-only
-// RUN: %clang_cc1 %s -cl-std=clc++ -verify -pedantic -fsyntax-only
+// RUN: %clang_cc1 %s -cl-std=clc++1.0 -verify -pedantic -fsyntax-only
+// RUN: %clang_cc1 %s -cl-std=clc++2021 
-cl-ext=+__opencl_c_generic_address_space -verify -pedantic -fsyntax-only
 
 __constant int ci = 1;
 
Index: clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
===
--- clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
+++ clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
@@ -1,12 +1,15 @@
 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DCONSTANT -cl-std=CL2.0
 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DGLOBAL -cl-std=CL2.0
 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DGENERIC -cl-std=CL2.0
-// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DCONSTANT -cl-std=clc++
-// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DGLOBAL -cl-std=clc++
-// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DGENERIC -cl-std=clc++
+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DCONSTANT -cl-std=clc++1.0
+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DGLOBAL -cl-std=clc++1.0
+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DGENERIC -cl-std=clc++1.0
 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DCONSTANT -cl-std=CL3.0 -cl-ext=+__opencl_c_generic_address_space
 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DGLOBAL -cl-std=CL3.0 -cl-ext=+__opencl_c_generic_address_space
 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DGENERIC -cl-std=CL3.0 -cl-ext=+__opencl_c_generic_address_space
+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DCONSTANT -cl-std=clc++2021 -cl-ext=+__opencl_c_generic_address_space
+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DGLOBAL -cl-std=clc++2021 -cl-ext=+__opencl_c_generic_address_space
+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only 
-DGENERIC -cl-std=clc++2021 -cl-ext=+__opencl_c_generic_address_space
 
 /* OpenCLC v2.0 adds a set of restrictions for conversions between pointers to
 *  different address spaces, mainly described in Sections 6.5.5 and 6.5.6.
Index: clang/lib/Basic/TargetInfo.cpp
===
--- clang/lib/Basic/TargetInfo.cpp
+++ clang/lib/Basic/TargetInfo.cpp
@@ -406,12 +406,13 @@
 // for OpenCL C 2.0 but with no access to target capabilities. Target
 // should be immutable once created and thus these language options need
 // to be defined only once.
-if (Opts.OpenCLVersion == 300) {
+if (Opts.getOpenCLCompatibleVersion() == 300) {
   const auto &OpenCLFeaturesMap = getSupportedOpenCLOpts();
   Opts.OpenCLGenericAddressSpace = hasFeatureEnabled(
   OpenCLFeaturesMap, "__opencl_c_generic_address_space");
-  Opts.OpenCLPipes =
-  has

[PATCH] D109060: Disable LIT tests on AIX due to lack of Objective-C support

2021-09-01 Thread Jake Egan via Phabricator via cfe-commits
Jake-Egan created this revision.
Jake-Egan requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109060

Files:
  clang/test/CodeGenObjC/2007-05-02-Strong.m
  clang/test/CodeGenObjC/2007-10-18-ProDescriptor.m
  clang/test/CodeGenObjC/2007-10-23-GC-WriteBarrier.m
  clang/test/CodeGenObjC/2008-08-25-incompatible-cond-expr.m
  clang/test/CodeGenObjC/2008-10-23-invalid-icmp.m
  clang/test/CodeGenObjC/2008-11-25-Blocks.m
  clang/test/CodeGenObjC/2009-01-21-invalid-debug-info.m
  clang/test/CodeGenObjC/2009-01-26-WriteBarrier-2.m
  clang/test/CodeGenObjC/2010-02-09-DbgSelf.m
  clang/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m
  clang/test/CodeGenObjC/2010-02-23-DbgInheritance.m
  clang/test/CodeGenObjC/arc-block-copy-escape.m
  clang/test/CodeGenObjC/attr-minsize.m
  clang/test/CodeGenObjC/bitfield-ivar-metadata.m
  clang/test/CodeGenObjC/class-getter-dotsyntax.m
  clang/test/CodeGenObjC/compatibility-alias.m
  clang/test/CodeGenObjC/continuation-class.m
  clang/test/CodeGenObjC/convert-messages-to-runtime-calls.m
  clang/test/CodeGenObjC/debug-info-class-extension.m
  clang/test/CodeGenObjC/debug-info-class-extension2.m
  clang/test/CodeGenObjC/debug-info-class-extension3.m
  clang/test/CodeGenObjC/debug-info-linkagename.m
  clang/test/CodeGenObjC/debug-info-nested-blocks.m
  clang/test/CodeGenObjC/debug-info-objc-property-dwarf5.m
  clang/test/CodeGenObjC/debug-info-property-class-extension.m
  clang/test/CodeGenObjC/debug-info-property-class-instance-same-name.m
  clang/test/CodeGenObjC/debug-info-property.m
  clang/test/CodeGenObjC/debug-info-property2.m
  clang/test/CodeGenObjC/debug-info-property3.m
  clang/test/CodeGenObjC/debug-info-property4.m
  clang/test/CodeGenObjC/debug-info-property5.m
  clang/test/CodeGenObjC/debug-info-selector.m
  clang/test/CodeGenObjC/debug-info-self.m
  clang/test/CodeGenObjC/debug-info-static-var.m
  clang/test/CodeGenObjC/debug-info-variadic-method.m
  clang/test/CodeGenObjC/debug-property-synth.m
  clang/test/CodeGenObjC/dot-syntax-1.m
  clang/test/CodeGenObjC/dot-syntax-2.m
  clang/test/CodeGenObjC/dot-syntax.m
  clang/test/CodeGenObjC/encode-test-4.m
  clang/test/CodeGenObjC/forward-class-impl-metadata.m
  clang/test/CodeGenObjC/forward-decl-param.m
  clang/test/CodeGenObjC/function-decay.m
  clang/test/CodeGenObjC/hidden.m
  clang/test/CodeGenObjC/ivars.m
  clang/test/CodeGenObjC/message-arrays.m
  clang/test/CodeGenObjC/messages.m
  clang/test/CodeGenObjC/newproperty-nested-synthesis-1.m
  clang/test/CodeGenObjC/no-sanitize.m
  clang/test/CodeGenObjC/objc-alloc-init.m
  clang/test/CodeGenObjC/objc-fixed-enum.m
  clang/test/CodeGenObjC/objc2-ivar-assign.m
  clang/test/CodeGenObjC/objc2-legacy-dispatch.m
  clang/test/CodeGenObjC/objc2-no-strong-cast.m
  clang/test/CodeGenObjC/objc2-strong-cast.m
  clang/test/CodeGenObjC/overloadable.m
  clang/test/CodeGenObjC/property-agrr-getter.m
  clang/test/CodeGenObjC/property-dbg.m
  clang/test/CodeGenObjC/property-getter-dot-syntax.m
  clang/test/CodeGenObjC/property-incr-decr-1.m
  clang/test/CodeGenObjC/protocol-property-synth.m
  clang/test/CodeGenObjC/related-result-type.m
  clang/test/CodeGenObjC/runtime-fns.m
  clang/test/CodeGenObjC/sel-as-builtin-type.m
  clang/test/CodeGenObjC/super-classmethod-category.m
  clang/test/CodeGenObjC/super-dotsyntax-property.m
  clang/test/CodeGenObjC/synthesize_ivar-cont-class.m
  clang/test/CodeGenObjC/synthesize_ivar.m
  clang/test/CodeGenObjC/ubsan-check-debuglocs.m
  clang/test/CodeGenObjC/unname-bf-metadata.m
  clang/test/CodeGenObjC/unqual-copy-restore.m
  clang/test/CodeGenObjCXX/2007-10-03-MetadataPointers.mm
  clang/test/CodeGenObjCXX/2010-08-04-Template.mm
  clang/test/CodeGenObjCXX/2010-08-06-X.Y-syntax.mm
  clang/test/CodeGenObjCXX/address-safety-attr.mm
  clang/test/CodeGenObjCXX/arc-mangle.mm
  clang/test/CodeGenObjCXX/crash-function-type.mm
  clang/test/CodeGenObjCXX/implementation-in-extern-c.mm
  clang/test/Import/forward-declared-objc-class/test.m
  clang/test/Import/objc-arc/test-cleanup-object.m
  clang/test/Import/objc-autoreleasepool/test.m
  clang/test/Import/objc-definitions-in-expression/test.m
  clang/test/Import/objc-method/test.m
  clang/test/Import/objc-param-decl/test.m
  clang/test/Import/objc-try-catch/test.m
  clang/test/Modules/DebugInfoNamespace.cpp
  clang/test/Modules/DebugInfoTransitiveImport.m
  clang/test/Modules/ExtDebugInfo.cpp
  clang/test/Modules/ExtDebugInfo.m
  clang/test/Modules/ModuleModuleDebugInfo.cpp
  clang/test/Modules/autolink.m
  clang/test/Modules/autolinkTBD.m
  clang/test/Modules/clang_module_file_info.m
  clang/test/Modules/cxx-irgen.cpp
  clang/test/Modules/debug-info-moduleimport.m
  clang/test/Modules/direct-module-import.m
  clang/test/Modules/module_file_info.m
  clang/test/Modules/pch-used.m
  clang/test/Modules/use-exportas-for-link.m
  clang/test/PCH/irgen-rdar13114142.mm
  clang/test/PCH/objc_container.m
  

[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield created this revision.
JonChesterfield added reviewers: jdoerfert, grokos, tianshilei1992.
Herald added subscribers: guansong, yaxunl.
JonChesterfield requested review of this revision.
Herald added subscribers: openmp-commits, cfe-commits, sstefan1.
Herald added projects: clang, OpenMP.

Given D109057 , change test runner to use the 
libomptarget-x-bc-path
argument instead of the LIBRARY_PATH environment variable to find the device
library.

Also drop the use of LIBRARY_PATH environment variable as it is far
too easy to pull in the device library from an unrelated toolchain by accident
with the current setup. No loss in flexibility to developers as the clang
commandline used here is still available.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109061

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  openmp/libomptarget/test/lit.cfg


Index: openmp/libomptarget/test/lit.cfg
===
--- openmp/libomptarget/test/lit.cfg
+++ openmp/libomptarget/test/lit.cfg
@@ -93,6 +93,10 @@
 append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
 append_dynamic_library_path('LIBRARY_PATH', \
 config.omp_host_rtl_directory, ":")
+if config.libomptarget_current_target.startswith('amdgcn'):
+config.test_flags += " --libomptarget-amdgcn-bc-path=" + 
config.library_dir
+if config.libomptarget_current_target.startswith('nvptx'):
+config.test_flags += " --libomptarget-nvptx-bc-path=" + 
config.library_dir
 
 # substitutions
 # - for targets that exist in the system create the actual command.
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1688,18 +1688,8 @@
StringRef BitcodeSuffix,
const llvm::Triple &Triple) {
   SmallVector LibraryPaths;
-  // Add user defined library paths from LIBRARY_PATH.
-  llvm::Optional LibPath =
-  llvm::sys::Process::GetEnv("LIBRARY_PATH");
-  if (LibPath) {
-SmallVector Frags;
-const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
-llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr);
-for (StringRef Path : Frags)
-  LibraryPaths.emplace_back(Path.trim());
-  }
-
-  // Add path to lib / lib64 folder.
+
+  // Add path to clang lib / lib64 folder.
   SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir);
   llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
   LibraryPaths.emplace_back(DefaultLibPath.c_str());
@@ -1709,22 +1699,26 @@
 : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
+  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
+
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
-std::string LibOmpTargetName(A->getValue());
-if (llvm::sys::fs::exists(LibOmpTargetName)) {
+SmallString<128> LibOmpTargetFile(A->getValue());
+if (llvm::sys::fs::exists(LibOmpTargetFile) &&
+llvm::sys::fs::is_directory(LibOmpTargetFile)) {
+  llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
+}
+
+if (llvm::sys::fs::exists(LibOmpTargetFile)) {
   CC1Args.push_back("-mlink-builtin-bitcode");
-  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
+  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
 } else {
   D.Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
-  << LibOmpTargetName;
+  << LibOmpTargetFile;
 }
   } else {
 bool FoundBCLibrary = false;
 
-std::string LibOmpTargetName =
-"libomptarget-" + BitcodeSuffix.str() + ".bc";
-
 for (StringRef LibraryPath : LibraryPaths) {
   SmallString<128> LibOmpTargetFile(LibraryPath);
   llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);


Index: openmp/libomptarget/test/lit.cfg
===
--- openmp/libomptarget/test/lit.cfg
+++ openmp/libomptarget/test/lit.cfg
@@ -93,6 +93,10 @@
 append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
 append_dynamic_library_path('LIBRARY_PATH', \
 config.omp_host_rtl_directory, ":")
+if config.libomptarget_current_target.startswith('amdgcn'):
+config.test_flags += " --libomptarget-amdgcn-bc-path=" + config.library_dir
+if config.libomptarget_current_target.startswith('nvptx'):
+config.test_flags += " --libomptarget-nvptx-bc-path=" + config.library_dir
 
 # substitutions
 # - for targets that exist in the system create the actual command.
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp

[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added inline comments.



Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1701
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
+  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";

This part is contained in D109057 which is intended to land first


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

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


[PATCH] D109060: Disable LIT tests on AIX due to lack of Objective-C support

2021-09-01 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

For `clang/test/CodeGenObjCXX` and `clang/test/CodeGenObjC`, can we add 
lit.local.cfg and add the unsupport there, no adding to every files in the 
folder?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109060/new/

https://reviews.llvm.org/D109060

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


[PATCH] D108917: [PowerPC] Define __powerpc and __PPC macros

2021-09-01 Thread Chris Bowler via Phabricator via cfe-commits
cebowleratibm added a comment.

The XL compiler only defined this weird form of the macros on AIX, but not on 
the XL Linux on Power compiler.  I think it's preferable that we define these 
macros only on AIX and in the source/commit messages indicate that we're only 
doing so for AIX XL C/C++ compatibility.  Users should prefer the __PPC__ and 
__powerpc__ macros.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108917/new/

https://reviews.llvm.org/D108917

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


[PATCH] D109060: [AIX] Disable LIT tests on AIX due to lack of Objective-C support

2021-09-01 Thread Jake Egan via Phabricator via cfe-commits
Jake-Egan added a comment.

In D109060#2976745 , @jsji wrote:

> For `clang/test/CodeGenObjCXX` and `clang/test/CodeGenObjC`, can we add 
> lit.local.cfg and add the unsupport there, no adding to every files in the 
> folder?

These tests are a subset of the tests in `clang/test/CodeGenObjCXX` and 
`clang/test/CodeGenObjC`. The rest of the tests in those folders are supported 
(cross-compiling).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109060/new/

https://reviews.llvm.org/D109060

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


[PATCH] D106262: [clang][analyzer] Use generic note tag in alpha.unix.Stream .

2021-09-01 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment.

The following test is not good in place of the 3rd? It is nearly the same, only 
the condition `(!ferror(F) && !feof(F))` is used instead of call to `clearerr`.

  void check_indeterminate_notes_fseek_no_feof_no_ferror() {
FILE *F;
char Buf[10];
F = fopen("foo1.c", "r");
if (!F) // expected-note {{Taking false branch}} expected-note {{'F' is 
non-null}}
  return;
fseek(F, 1, SEEK_SET);  // expected-note {{Assuming this stream 
operation fails}}
if (!ferror(F) && !feof(F)) // expected-note {{Taking true branch}} // 
expected-note {{Left side of '&&' is true}}
  fread(Buf, 1, 1, F);  // expected-warning {{File position of the 
stream might be 'indeterminate' after a failed operation. Can cause undefined 
behavior}}
// expected-note@-1 {{File position of the stream might be 'indeterminate' 
after a failed operation. Can cause undefined behavior}}
fclose(F);
  }

The condition  can be changed to `feof(F)` or `ferror(F)` to change the bug 
type and the note message at `fseek`.

The following test is good too to test if the message depends on the bug type 
(note check comments are not included):

  void check_notes_fseek() {
FILE *F;
char Buf[10];
F = fopen("foo1.c", "r");
if (!F) // expected-note {{Taking false branch}} expected-note {{'F' is 
non-null}}
  return;
fseek(F, 1, SEEK_SET);
fread(Buf, 1, 1, F); // expected-warning {{File position of the stream 
might be 'indeterminate' after a failed operation. Can cause undefined behavior 
[alpha.unix.Stream]}}
 // expected-warning@-1 {{Read function called when 
stream is in EOF state. Function has no effect [alpha.unix.Stream]}}
fclose(F);
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106262/new/

https://reviews.llvm.org/D106262

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


[PATCH] D109060: [AIX] Disable LIT tests on AIX due to lack of Objective-C support

2021-09-01 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

In D109060#2976752 , @Jake-Egan wrote:

> In D109060#2976745 , @jsji wrote:
>
>> For `clang/test/CodeGenObjCXX` and `clang/test/CodeGenObjC`, can we add 
>> lit.local.cfg and add the unsupport there, no adding to every files in the 
>> folder?
>
> These tests are a subset of `clang/test/CodeGenObjCXX` and 
> `clang/test/CodeGenObjC`. The rest of the tests in those folders are 
> supported (cross-compiling).

We don't have `Objective-C ` support, so any passing tests are just somehow a 
luck, and I don't think it is meaningful to even run those tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109060/new/

https://reviews.llvm.org/D109060

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


[PATCH] D108917: [PowerPC] Define __powerpc and __PPC macros

2021-09-01 Thread Jake Egan via Phabricator via cfe-commits
Jake-Egan updated this revision to Diff 369932.
Jake-Egan added a comment.

Define for  AIX only.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108917/new/

https://reviews.llvm.org/D108917

Files:
  clang/lib/Basic/Targets/PPC.cpp
  clang/test/Preprocessor/init-ppc.c


Index: clang/test/Preprocessor/init-ppc.c
===
--- clang/test/Preprocessor/init-ppc.c
+++ clang/test/Preprocessor/init-ppc.c
@@ -517,6 +517,7 @@
 // PPC-AIX-NOT:#define __NATURAL_ALIGNMENT__ 1
 // PPC-AIX:#define __POINTER_WIDTH__ 32
 // PPC-AIX:#define __POWERPC__ 1
+// PPC-AIX:#define __PPC 1
 // PPC-AIX:#define __PPC__ 1
 // PPC-AIX:#define __PTRDIFF_TYPE__ long int
 // PPC-AIX:#define __PTRDIFF_WIDTH__ 32
@@ -584,6 +585,7 @@
 // PPC-AIX:#define __WCHAR_WIDTH__ 16
 // PPC-AIX:#define __WINT_TYPE__ int
 // PPC-AIX:#define __WINT_WIDTH__ 32
+// PPC-AIX:#define __powerpc 1
 // PPC-AIX:#define __powerpc__ 1
 // PPC-AIX:#define __ppc__ 1
 
Index: clang/lib/Basic/Targets/PPC.cpp
===
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -264,6 +264,9 @@
   }
   if (getTriple().isOSAIX()) {
 Builder.defineMacro("__THW_PPC__");
+// Define __PPC and __powerpc for AIX XL C/C++ compatibility
+Builder.defineMacro("__PPC");
+Builder.defineMacro("__powerpc");
   }
 
   // Target properties.


Index: clang/test/Preprocessor/init-ppc.c
===
--- clang/test/Preprocessor/init-ppc.c
+++ clang/test/Preprocessor/init-ppc.c
@@ -517,6 +517,7 @@
 // PPC-AIX-NOT:#define __NATURAL_ALIGNMENT__ 1
 // PPC-AIX:#define __POINTER_WIDTH__ 32
 // PPC-AIX:#define __POWERPC__ 1
+// PPC-AIX:#define __PPC 1
 // PPC-AIX:#define __PPC__ 1
 // PPC-AIX:#define __PTRDIFF_TYPE__ long int
 // PPC-AIX:#define __PTRDIFF_WIDTH__ 32
@@ -584,6 +585,7 @@
 // PPC-AIX:#define __WCHAR_WIDTH__ 16
 // PPC-AIX:#define __WINT_TYPE__ int
 // PPC-AIX:#define __WINT_WIDTH__ 32
+// PPC-AIX:#define __powerpc 1
 // PPC-AIX:#define __powerpc__ 1
 // PPC-AIX:#define __ppc__ 1
 
Index: clang/lib/Basic/Targets/PPC.cpp
===
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -264,6 +264,9 @@
   }
   if (getTriple().isOSAIX()) {
 Builder.defineMacro("__THW_PPC__");
+// Define __PPC and __powerpc for AIX XL C/C++ compatibility
+Builder.defineMacro("__PPC");
+Builder.defineMacro("__powerpc");
   }
 
   // Target properties.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D107882: BPF: Enable frontend constant folding for VLA size

2021-09-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment.

@rsmith ping again, did you get a time to take a look?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107882/new/

https://reviews.llvm.org/D107882

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


[PATCH] D108299: [MSP430][Clang] Remove support for -mmcu=msp430

2021-09-01 Thread Jozef Lawrynowicz via Phabricator via cfe-commits
jozefl added a comment.

Pinging for review.

Thanks,
Jozef


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108299/new/

https://reviews.llvm.org/D108299

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


[PATCH] D108695: [analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it

2021-09-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 369935.
Szelethus marked 5 inline comments as done.
Szelethus added a comment.
Herald added a subscriber: mgorny.

- Make sure that the matching CallExitEnd is retrieved.
- Add a unit test to neatly demonstrate how the visitor is intended to be used.
- Fix the rest of the nits.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108695/new/

https://reviews.llvm.org/D108695

Files:
  clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
  clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
  clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
  clang/unittests/StaticAnalyzer/CMakeLists.txt
  clang/unittests/StaticAnalyzer/CallEventTest.cpp
  clang/unittests/StaticAnalyzer/CheckerRegistration.h
  clang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp
  clang/unittests/StaticAnalyzer/NoStateChangeFuncVisitorTest.cpp
  clang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp

Index: clang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
===
--- clang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
+++ clang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
@@ -51,7 +51,7 @@
 TEST(RegisterCustomCheckers, RegisterChecker) {
   std::string Diags;
   EXPECT_TRUE(runCheckerOnCode("void f() {;}", Diags));
-  EXPECT_EQ(Diags, "test.CustomChecker:Custom diagnostic description\n");
+  EXPECT_EQ(Diags, "test.CustomChecker: Custom diagnostic description\n");
 }
 
 //===--===//
@@ -169,7 +169,7 @@
 TEST(RegisterDeps, UnsatisfiedDependency) {
   std::string Diags;
   EXPECT_TRUE(runCheckerOnCode("void f() {int i;}", Diags));
-  EXPECT_EQ(Diags, "test.RegistrationOrder:test.RegistrationOrder\n");
+  EXPECT_EQ(Diags, "test.RegistrationOrder: test.RegistrationOrder\n");
 }
 
 //===--===//
@@ -272,7 +272,7 @@
   std::string Diags;
   EXPECT_TRUE(runCheckerOnCode(
   "void f() {int i;}", Diags));
-  EXPECT_EQ(Diags, "test.RegistrationOrder:test.WeakDep\ntest."
+  EXPECT_EQ(Diags, "test.RegistrationOrder: test.WeakDep\ntest."
"Dep\ntest.RegistrationOrder\n");
   Diags.clear();
 
@@ -280,31 +280,33 @@
   // but the dependencies are switched.
   EXPECT_TRUE(runCheckerOnCode(
   "void f() {int i;}", Diags));
-  EXPECT_EQ(Diags, "test.RegistrationOrder:test.Dep\ntest."
+  EXPECT_EQ(Diags, "test.RegistrationOrder: test.Dep\ntest."
"RegistrationOrder\ntest.WeakDep\n");
   Diags.clear();
 
   // Weak dependencies dont prevent dependent checkers from being enabled.
   EXPECT_TRUE(runCheckerOnCode(
   "void f() {int i;}", Diags));
-  EXPECT_EQ(Diags, "test.RegistrationOrder:test.Dep\ntest.RegistrationOrder\n");
+  EXPECT_EQ(Diags,
+"test.RegistrationOrder: test.Dep\ntest.RegistrationOrder\n");
   Diags.clear();
 
   // Nor will they be enabled just because a dependent checker is.
   EXPECT_TRUE(runCheckerOnCode(
   "void f() {int i;}", Diags));
-  EXPECT_EQ(Diags, "test.RegistrationOrder:test.Dep\ntest.RegistrationOrder\n");
+  EXPECT_EQ(Diags,
+"test.RegistrationOrder: test.Dep\ntest.RegistrationOrder\n");
   Diags.clear();
 
   EXPECT_TRUE(
   runCheckerOnCode("void f() {int i;}", Diags));
-  EXPECT_EQ(Diags, "test.RegistrationOrder:test.WeakDep2\ntest."
+  EXPECT_EQ(Diags, "test.RegistrationOrder: test.WeakDep2\ntest."
"Dep\ntest.RegistrationOrder\n");
   Diags.clear();
 
   EXPECT_TRUE(
   runCheckerOnCode("void f() {int i;}", Diags));
-  EXPECT_EQ(Diags, "test.RegistrationOrder:test.WeakDep2\ntest."
+  EXPECT_EQ(Diags, "test.RegistrationOrder: test.WeakDep2\ntest."
"WeakDep\ntest.Dep\ntest.RegistrationOrder\n");
   Diags.clear();
 }
@@ -414,7 +416,7 @@
   std::string Diags;
   EXPECT_TRUE(
   runCheckerOnCode("void f() {int i;}", Diags));
-  EXPECT_EQ(Diags, "test.RegistrationOrder:test.StrongDep\ntest."
+  EXPECT_EQ(Diags, "test.RegistrationOrder: test.StrongDep\ntest."
"WeakDep\ntest.Dep\ntest.RegistrationOrder\n");
   Diags.clear();
 
@@ -424,14 +426,14 @@
   // established in between the modeling portion and the weak dependency.
   EXPECT_TRUE(
   runCheckerOnCode("void f() {int i;}", Diags));
-  EXPECT_EQ(Diags, "test.RegistrationOrder:test.WeakDep\ntest."
+  EXPECT_EQ(Diags, "test.RegistrationOrder: test.WeakDep\ntest."
"StrongDep\ntest.Dep\ntest.RegistrationOrder\n");
   Diags.clear();
 
   // If a weak dependency is disabled, the checker itself can still be enabled.
   EXPECT_TRUE(runCheckerOnCode(
   "void f() {int i;}", Diags));
-  EXPECT_EQ(Diags, "test.RegistrationOrder:test.Dep\ntest."
+  EXPECT_EQ(Diags, "test.RegistrationOrder: test.Dep\ntest."
"RegistrationOrder\ntest.StrongDep\n");
   Diags.clear();
 
@@ -439,20 +44

[PATCH] D107764: [OpenMP][OpenMPIRBuilder] Implement loop unrolling.

2021-09-01 Thread Kiran Chandramohan via Phabricator via cfe-commits
kiranchandramohan accepted this revision.
kiranchandramohan added a comment.

LGTM. Thanks for the responses.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107764/new/

https://reviews.llvm.org/D107764

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


[PATCH] D108695: [analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it

2021-09-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done.
Szelethus added inline comments.



Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:361
+  while (!SCtx->inTopFrame()) {
+auto p = FramesModifying.insert(SCtx);
+if (!p.second)

martong wrote:
> Why don't we add the stack frame here to `FramesModifyingCalculated` as well? 
> If we are in a nested stack frame and we step back to a parent then it would 
> be redundant to do the calculation again for the parent.
> 
> Ahh, to be honest, I think the idea of having both `FramesModifying` and 
> `FramesModifyingCalculated` separated is prone to errors.
> Why don't we have a simple map with the boolean true 
> meaning that the frame is modifying? And if the frame is not in the map that 
> means it had never been calculated before.
Yes, its stupid, but its just the one thing I didn't want to bother myself 
with. Though I agree it'd be better to drop these sets for something a lot more 
elegant. Btw mind that we insert into the calculated set each time we enter a 
new stack frame.

I'll leave a TODO, if you don't mind.



Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:369
+static const ExplodedNode *getCallExitEnd(const ExplodedNode *N) {
+  while (N && !N->getLocationAs())
+N = N->getFirstSucc();

NoQ wrote:
> Wait, no, I don't think this test is sufficient. You may run into a 
> `CallExitEnd` of a nested stack frame before you reach the `CallExitEnd` of 
> the stack frame in question:
> ```
> -> CallEnter foo()   --->
>   -> CallEnter bar()|
>   <- CallExitEnd bar()  <--- ???
> <- CallExitEnd foo()
> ```
Good point. Added a bunch of asserts and changed to code to both retrieve, and 
ensure that the correct node is retrieved.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108695/new/

https://reviews.llvm.org/D108695

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


[clang-tools-extra] d8afa57 - [clang-tidy] Fix documentation typos (NFC)

2021-09-01 Thread Kazu Hirata via cfe-commits

Author: Kazu Hirata
Date: 2021-09-01T08:48:31-07:00
New Revision: d8afa5777b66f6193aac3c6b0dcb5680f8cf0d3d

URL: 
https://github.com/llvm/llvm-project/commit/d8afa5777b66f6193aac3c6b0dcb5680f8cf0d3d
DIFF: 
https://github.com/llvm/llvm-project/commit/d8afa5777b66f6193aac3c6b0dcb5680f8cf0d3d.diff

LOG: [clang-tidy] Fix documentation typos (NFC)

Added: 


Modified: 
clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst
clang-tools-extra/docs/clang-tidy/checks/abseil-time-subtraction.rst
clang-tools-extra/docs/clang-tidy/checks/bugprone-fold-init-type.rst

clang-tools-extra/docs/clang-tidy/checks/bugprone-redundant-branch-condition.rst
clang-tools-extra/docs/clang-tidy/checks/bugprone-signal-handler.rst

clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-memory-comparison.rst

clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst

clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst
clang-tools-extra/docs/clang-tidy/checks/cert-oop57-cpp.rst

clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst
clang-tools-extra/docs/clang-tidy/checks/google-upgrade-googletest-case.rst
clang-tools-extra/docs/clang-tidy/checks/hicpp-no-assembler.rst

clang-tools-extra/docs/clang-tidy/checks/readability-redundant-member-init.rst

Removed: 




diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst 
b/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst
index 75e72adf5f36b..1032cc3db5fae 100644
--- 
a/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst
+++ 
b/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst
@@ -5,7 +5,7 @@ abseil-no-internal-dependencies
 
 Warns if code using Abseil depends on internal details. If something is in a
 namespace that includes the word "internal", code is not allowed to depend upon
-it beaucse it’s an implementation detail. They cannot friend it, include it,
+it because it’s an implementation detail. They cannot friend it, include it,
 you mention it or refer to it in any way. Doing so violates Abseil's
 compatibility guidelines and may result in breakage. See
 https://abseil.io/about/compatibility for more information.

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/abseil-time-subtraction.rst 
b/clang-tools-extra/docs/clang-tidy/checks/abseil-time-subtraction.rst
index 196c07362ffc4..c717ed389216a 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/abseil-time-subtraction.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/abseil-time-subtraction.rst
@@ -25,7 +25,7 @@ Examples:
   int x;
   absl::Time t;
 
-  // Original - absl::Duration result and first operand is a absl::Time.
+  // Original - absl::Duration result and first operand is an absl::Time.
   absl::Duration d = absl::Seconds(absl::ToUnixSeconds(t) - x);
 
   // Suggestion - Perform subtraction in the Time domain instead.

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone-fold-init-type.rst 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone-fold-init-type.rst
index 3b1bd7ff3a79a..8c6872d72f11a 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-fold-init-type.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-fold-init-type.rst
@@ -11,7 +11,7 @@ the latter, with ``operator+`` by default. This can cause 
loss of precision
 through:
 
 - Truncation: The following code uses a floating point range and an int
-  initial value, so trucation will happen at every application of ``operator+``
+  initial value, so truncation will happen at every application of 
``operator+``
   and the result will be `0`, which might not be what the user expected.
 
 .. code-block:: c++

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone-redundant-branch-condition.rst
 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone-redundant-branch-condition.rst
index c2746914e754a..a6fff9c29ab24 100644
--- 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone-redundant-branch-condition.rst
+++ 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone-redundant-branch-condition.rst
@@ -41,7 +41,7 @@ is an operand of a logical "and" (``&&``) or a logical "or" 
(``||``) operator:
 
 In the first case (logical "and") the suggested fix is to remove the redundant
 condition variable and keep the other side of the ``&&``. In the second case
-(logical "or") the whole ``if`` is removed similarily to the simple case on the
+(logical "or") the whole ``if`` is removed similarly to the simple case on the
 top.
 
 The condition of the outer ``if`` statement may also be a logical "and" 
(``&&``)

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone-signal-handler.rst 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone-signal-handler.rst
index fa05460ab93

[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

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


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

LG, but please add a test for this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

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


[PATCH] D108917: [AIX][PowerPC] Define __powerpc and __PPC macros

2021-09-01 Thread Chris Bowler via Phabricator via cfe-commits
cebowleratibm requested changes to this revision.
cebowleratibm added inline comments.
This revision now requires changes to proceed.



Comment at: clang/test/Preprocessor/init-ppc.c:520
 // PPC-AIX:#define __POWERPC__ 1
+// PPC-AIX:#define __PPC 1
 // PPC-AIX:#define __PPC__ 1

I suggest adding the negative test for the non AIX target for both __PPC 
and__powerpc


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108917/new/

https://reviews.llvm.org/D108917

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


[PATCH] D108421: Mark openmp internal global dso_local

2021-09-01 Thread kamlesh kumar via Phabricator via cfe-commits
kamleshbhalui added a comment.

In D108421#2958848 , @MaskRay wrote:

> If you read the comment in TargetMachine::shouldAssumeDSOLocal: this is the 
> wrong direction. dso_local is assumed to be marked by the frontend.
>
> Direct accesses and GOT accesses are trade-offs. Direct accesses are not 
> always preferred. The MachO special case is an unfortunate case for their xnu 
> kernel, not a good example here.

@MaskRay I would like to know more about these trade-offs details, any 
supporting documents will do.
Considering below testcase, can you shed some light how code generated by 
llc-12 is better than llc-11 for given testcase?
https://godbolt.org/z/x9xojWb58
And FYI this testcase does not work when build as Linux Kernel Module. LKM 
loader throw error("Unknown rela relocation: 42")?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108421/new/

https://reviews.llvm.org/D108421

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


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment.

In D109057#2977084 , @jdoerfert wrote:

> LG, but please add a test for this.

D109061  sends everything in check-openmp 
down this code path, but we should indeed have a check for the file and for the 
dir version. Will take a look


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

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


[PATCH] D106809: [clang-offload-bundler] Make Bundle Entry ID backward compatible

2021-09-01 Thread Saiyedul Islam via Phabricator via cfe-commits
saiislam added a comment.

Ping.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106809/new/

https://reviews.llvm.org/D106809

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


[PATCH] D108421: Mark openmp internal global dso_local

2021-09-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay requested changes to this revision.
MaskRay added a comment.
This revision now requires changes to proceed.

In D108421#2977107 , @kamleshbhalui 
wrote:

> In D108421#2958848 , @MaskRay wrote:
>
>> If you read the comment in TargetMachine::shouldAssumeDSOLocal: this is the 
>> wrong direction. dso_local is assumed to be marked by the frontend.
>>
>> Direct accesses and GOT accesses are trade-offs. Direct accesses are not 
>> always preferred. The MachO special case is an unfortunate case for their 
>> xnu kernel, not a good example here.
>
> @MaskRay I would like to know more about these trade-offs details, any 
> supporting documents will do.
> Considering below testcase, can you shed some light how code generated by 
> llc-12 is better than llc-11 for given testcase?
> https://godbolt.org/z/x9xojWb58

This is a very minor issue. First, global variable access is rarely a 
performance bottleneck.
Second, if the symbol turns out to be non-preemptible (which implies that it is 
defined in the component), the R_X86_64_REX_GOTPCRELX GOT indirection can be 
optimized out.
The only minor issue is slightly longer code sequence.

> And FYI this testcase does not work when build as Linux Kernel Module. LKM 
> loader throw error("Unknown rela relocation: 42")?

This is a kernel issue. Please mention the justification (is it related to 
OpenMP?) in the first place.
The kernel can be compiled in -fpie mode. In this mode, taking the address of a 
default-visibility undefined symbol uses R_X86_64_REX_GOTPCRELX.
So the kernel should support R_X86_64_REX_GOTPCRELX anyway.

---

If we think the optimization is meaningful:

Depending on the property of `.gomp_critical_user_.atomic_reduction.var` 
different DSOLocal strategies should be used.
If it is TU-local, make it local linkage. If it is linked image local, make it 
hidden visibility.
If it may be defined in a shared object and shared with other shared objects or 
the main executable, (not so sure because such symbol interposition does not 
work in other binary formats), use dso_preemptable as is.

I believe the current forced dso_local is definitely incorrect because it may 
break `-fpic -shared` links.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108421/new/

https://reviews.llvm.org/D108421

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


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield updated this revision to Diff 369969.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

Files:
  clang/test/Driver/openmp-offload-gpu.c


Index: clang/test/Driver/openmp-offload-gpu.c
===
--- clang/test/Driver/openmp-offload-gpu.c
+++ clang/test/Driver/openmp-offload-gpu.c
@@ -165,10 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_50 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
+// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget/libomptarget-nvptx-sm_50.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###


Index: clang/test/Driver/openmp-offload-gpu.c
===
--- clang/test/Driver/openmp-offload-gpu.c
+++ clang/test/Driver/openmp-offload-gpu.c
@@ -165,10 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_50 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
+// CHK-BCLIB-USER-DIR: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget/libomptarget-nvptx-sm_50.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment.

Well, that's not helpful. Managed to add a test through the webui as arcanist 
was misbehaving but it has worked by deleting the functional change. Will try 
again


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

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


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield updated this revision to Diff 369971.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/test/Driver/openmp-offload-gpu.c


Index: clang/test/Driver/openmp-offload-gpu.c
===
--- clang/test/Driver/openmp-offload-gpu.c
+++ clang/test/Driver/openmp-offload-gpu.c
@@ -165,10 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_50 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
+// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget/libomptarget-nvptx-sm_50.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1709,22 +1709,26 @@
 : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
+  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
+
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
-std::string LibOmpTargetName(A->getValue());
-if (llvm::sys::fs::exists(LibOmpTargetName)) {
+SmallString<128> LibOmpTargetFile(A->getValue());
+if (llvm::sys::fs::exists(LibOmpTargetFile) &&
+llvm::sys::fs::is_directory(LibOmpTargetFile)) {
+  llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
+}
+
+if (llvm::sys::fs::exists(LibOmpTargetFile)) {
   CC1Args.push_back("-mlink-builtin-bitcode");
-  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
+  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
 } else {
   D.Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
-  << LibOmpTargetName;
+  << LibOmpTargetFile;
 }
   } else {
 bool FoundBCLibrary = false;
 
-std::string LibOmpTargetName =
-"libomptarget-" + BitcodeSuffix.str() + ".bc";
-
 for (StringRef LibraryPath : LibraryPaths) {
   SmallString<128> LibOmpTargetFile(LibraryPath);
   llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);


Index: clang/test/Driver/openmp-offload-gpu.c
===
--- clang/test/Driver/openmp-offload-gpu.c
+++ clang/test/Driver/openmp-offload-gpu.c
@@ -165,10 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_50 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
+// CHK-BCLIB-USER-DIR: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget/libomptarget-nvptx-sm_50.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###

[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield updated this revision to Diff 369972.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/test/Driver/openmp-offload-gpu.c


Index: clang/test/Driver/openmp-offload-gpu.c
===
--- clang/test/Driver/openmp-offload-gpu.c
+++ clang/test/Driver/openmp-offload-gpu.c
@@ -165,10 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
+// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget/libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1709,22 +1709,26 @@
 : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
+  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
+
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
-std::string LibOmpTargetName(A->getValue());
-if (llvm::sys::fs::exists(LibOmpTargetName)) {
+SmallString<128> LibOmpTargetFile(A->getValue());
+if (llvm::sys::fs::exists(LibOmpTargetFile) &&
+llvm::sys::fs::is_directory(LibOmpTargetFile)) {
+  llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
+}
+
+if (llvm::sys::fs::exists(LibOmpTargetFile)) {
   CC1Args.push_back("-mlink-builtin-bitcode");
-  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
+  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
 } else {
   D.Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
-  << LibOmpTargetName;
+  << LibOmpTargetFile;
 }
   } else {
 bool FoundBCLibrary = false;
 
-std::string LibOmpTargetName =
-"libomptarget-" + BitcodeSuffix.str() + ".bc";
-
 for (StringRef LibraryPath : LibraryPaths) {
   SmallString<128> LibOmpTargetFile(LibraryPath);
   llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);


Index: clang/test/Driver/openmp-offload-gpu.c
===
--- clang/test/Driver/openmp-offload-gpu.c
+++ clang/test/Driver/openmp-offload-gpu.c
@@ -165,10 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_35 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
+// CHK-BCLIB-USER-DIR: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget/libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###

[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment.

OK, test added, same code as originally, checked that the test fails on trunk. 
Because it's driver only we don't get a far as the fatal error, but you can see 
the driver passing the directory through to builtin-bitcode. Will land when the 
premerge checks catch up.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

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


[PATCH] D109002: [OpenCL] Supports optional image types in C++ for OpenCL 2021

2021-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments.



Comment at: clang/lib/Sema/SemaType.cpp:1729
 bool IsOpenCLC30 = (S.getLangOpts().OpenCLVersion == 300);
+bool IsOpenCLC30Comp = S.getLangOpts().getOpenCLCompatibleVersion() == 300;
 // OpenCL C v3.0 s6.3.3 - OpenCL image types require __opencl_c_images

Topotuna wrote:
> Anastasia wrote:
> > I think we should just replace `IsOpenCLC30` as it is when only used in the 
> > diagnostic that we should report the same as for OpenCL 3.0.
> > 
> > 
> > Also I would suggest changing name to `IsOpenCLC30Compatible` to make it 
> > clearer. 
> That diagnostic is responsible for `__opencl_c_3d_image_writes` feature while 
> current commit addresses `__opencl_c_images`. I wanted to keep commits 
> separate and was planning to finish transitioning from `IsOpenCLC30` to 
> `IsOpenCLC30Compatible` in a future commit.
> 
> I agree that `IsOpenCLC30Compatible` would be clearer. Thank you.
Ok, let's just only rename it for now and add a FIXME comment explaining that 
the variables should be unified later on.

I suspect your subsequent commits would include the unification?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109002/new/

https://reviews.llvm.org/D109002

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


[PATCH] D108461: [OpenCL] Supports optional generic address space sematics in C++ for OpenCL 2021

2021-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.

LGTM! Thanks




Comment at: clang/lib/Basic/TargetInfo.cpp:413
   OpenCLFeaturesMap, "__opencl_c_generic_address_space");
-  Opts.OpenCLPipes =
-  hasFeatureEnabled(OpenCLFeaturesMap, "__opencl_c_pipes");
+  if (Opts.OpenCLVersion == 300)
+Opts.OpenCLPipes =

Ok, I am guessing this will be changed back to one check later on?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108461/new/

https://reviews.llvm.org/D108461

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


[PATCH] D104386: [PowerPC][Builtins] Added a number of builtins for compatibility with XL.

2021-09-01 Thread Nemanja Ivanovic via Phabricator via cfe-commits
nemanjai added a comment.

The idea with putting all of these in a separate function was to:

1. Make it easy to limit it to specific targets as I suggested above
2. Have them all in one place to easily identify which ones are added for this 
compatibility so we can eventually pull this support once they are no longer 
needed
3. Just kind of isolate this to keep it out of the way

I really think the best way forward might be to limit this to Linux and AIX. I 
don't think IBM provided XLC/C++ on FreeBSD.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104386/new/

https://reviews.llvm.org/D104386

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


[PATCH] D102531: PR45881: Properly use CXXThisOverride for templated lambda

2021-09-01 Thread Gulfem Savrun Yeniceri via Phabricator via cfe-commits
gulfem added a comment.

We recently enabled assertions in our Fuchsia builds, and our builds started to 
fail:

  FAILED: obj/src/lib/storage/vfs/cpp/libcpp.fuchsia_vfs.cc.o
  ../../../recipe_cleanup/clangLhcV7J/bin/clang++ -MD -MF 
obj/src/lib/storage/vfs/cpp/libcpp.fuchsia_vfs.cc.o.d 
-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS 
-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -…
  clang++: clang/lib/Sema/SemaExprCXX.cpp:1144: clang::QualType 
adjustCVQualifiersForCXXThisWithinLambda(ArrayRef, clang::QualType, clang::DeclContext *, clang::ASTC…
  clang++: error: clang frontend command failed with exit code 134 (use -v to 
see invocation)

https://luci-milo.appspot.com/ui/p/fuchsia/builders/ci/clang_toolchain.core.x64-debug/b8837288282633988801/overview

This patch seems to be fixing the issue that we are running.
Is there a way to speed up the process in this review, so our broken builds can 
be fixed?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102531/new/

https://reviews.llvm.org/D102531

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


[PATCH] D102531: PR45881: Properly use CXXThisOverride for templated lambda

2021-09-01 Thread Gulfem Savrun Yeniceri via Phabricator via cfe-commits
gulfem added a comment.

@aaron.ballman would it be possible for you to review this patch, so we can fix 
our broken builds?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102531/new/

https://reviews.llvm.org/D102531

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


[PATCH] D108917: [AIX][PowerPC] Define __powerpc and __PPC macros

2021-09-01 Thread Jake Egan via Phabricator via cfe-commits
Jake-Egan updated this revision to Diff 369992.
Jake-Egan added a comment.

Add negative test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108917/new/

https://reviews.llvm.org/D108917

Files:
  clang/lib/Basic/Targets/PPC.cpp
  clang/test/Preprocessor/init-ppc.c


Index: clang/test/Preprocessor/init-ppc.c
===
--- clang/test/Preprocessor/init-ppc.c
+++ clang/test/Preprocessor/init-ppc.c
@@ -320,6 +320,7 @@
 // PPC:#define __NATURAL_ALIGNMENT__ 1
 // PPC:#define __POINTER_WIDTH__ 32
 // PPC:#define __POWERPC__ 1
+// PPC-NOT:#define __PPC 1
 // PPC:#define __PPC__ 1
 // PPC:#define __PTRDIFF_TYPE__ long int
 // PPC:#define __PTRDIFF_WIDTH__ 32
@@ -384,6 +385,7 @@
 // PPC:#define __WCHAR_WIDTH__ 32
 // PPC:#define __WINT_TYPE__ int
 // PPC:#define __WINT_WIDTH__ 32
+// PPC-NOT:#define __powerpc 1
 // PPC:#define __ppc__ 1
 
 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 
-fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix 
PPC-AIX %s
@@ -517,6 +519,7 @@
 // PPC-AIX-NOT:#define __NATURAL_ALIGNMENT__ 1
 // PPC-AIX:#define __POINTER_WIDTH__ 32
 // PPC-AIX:#define __POWERPC__ 1
+// PPC-AIX:#define __PPC 1
 // PPC-AIX:#define __PPC__ 1
 // PPC-AIX:#define __PTRDIFF_TYPE__ long int
 // PPC-AIX:#define __PTRDIFF_WIDTH__ 32
@@ -584,6 +587,7 @@
 // PPC-AIX:#define __WCHAR_WIDTH__ 16
 // PPC-AIX:#define __WINT_TYPE__ int
 // PPC-AIX:#define __WINT_WIDTH__ 32
+// PPC-AIX:#define __powerpc 1
 // PPC-AIX:#define __powerpc__ 1
 // PPC-AIX:#define __ppc__ 1
 
Index: clang/lib/Basic/Targets/PPC.cpp
===
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -264,6 +264,9 @@
   }
   if (getTriple().isOSAIX()) {
 Builder.defineMacro("__THW_PPC__");
+// Define __PPC and __powerpc for AIX XL C/C++ compatibility
+Builder.defineMacro("__PPC");
+Builder.defineMacro("__powerpc");
   }
 
   // Target properties.


Index: clang/test/Preprocessor/init-ppc.c
===
--- clang/test/Preprocessor/init-ppc.c
+++ clang/test/Preprocessor/init-ppc.c
@@ -320,6 +320,7 @@
 // PPC:#define __NATURAL_ALIGNMENT__ 1
 // PPC:#define __POINTER_WIDTH__ 32
 // PPC:#define __POWERPC__ 1
+// PPC-NOT:#define __PPC 1
 // PPC:#define __PPC__ 1
 // PPC:#define __PTRDIFF_TYPE__ long int
 // PPC:#define __PTRDIFF_WIDTH__ 32
@@ -384,6 +385,7 @@
 // PPC:#define __WCHAR_WIDTH__ 32
 // PPC:#define __WINT_TYPE__ int
 // PPC:#define __WINT_WIDTH__ 32
+// PPC-NOT:#define __powerpc 1
 // PPC:#define __ppc__ 1
 
 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX %s
@@ -517,6 +519,7 @@
 // PPC-AIX-NOT:#define __NATURAL_ALIGNMENT__ 1
 // PPC-AIX:#define __POINTER_WIDTH__ 32
 // PPC-AIX:#define __POWERPC__ 1
+// PPC-AIX:#define __PPC 1
 // PPC-AIX:#define __PPC__ 1
 // PPC-AIX:#define __PTRDIFF_TYPE__ long int
 // PPC-AIX:#define __PTRDIFF_WIDTH__ 32
@@ -584,6 +587,7 @@
 // PPC-AIX:#define __WCHAR_WIDTH__ 16
 // PPC-AIX:#define __WINT_TYPE__ int
 // PPC-AIX:#define __WINT_WIDTH__ 32
+// PPC-AIX:#define __powerpc 1
 // PPC-AIX:#define __powerpc__ 1
 // PPC-AIX:#define __ppc__ 1
 
Index: clang/lib/Basic/Targets/PPC.cpp
===
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -264,6 +264,9 @@
   }
   if (getTriple().isOSAIX()) {
 Builder.defineMacro("__THW_PPC__");
+// Define __PPC and __powerpc for AIX XL C/C++ compatibility
+Builder.defineMacro("__PPC");
+Builder.defineMacro("__powerpc");
   }
 
   // Target properties.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D108761: [OpenCL] Remove decls for scalar vloada_half and vstorea_half* fns

2021-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.

LGTM! Thanks


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108761/new/

https://reviews.llvm.org/D108761

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


[PATCH] D108470: [OpenCL] Fix as_type3 invalid store creation

2021-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.

LGTM! Thanks


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108470/new/

https://reviews.llvm.org/D108470

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


[PATCH] D109078: [clang][driver][AIX] Add system libc++ header paths to driver

2021-09-01 Thread David Tenty via Phabricator via cfe-commits
daltenty created this revision.
daltenty added reviewers: hubert.reinterpretcast, stevewan, ZarkoCA.
daltenty requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This change adds the system libc++ header location to the driver. As well we 
define
the __LIBC_NO_CPP_MATH_OVERLOADS__ when using those headers, in order to 
suppress
conflicting C++ overloads in the system libc headers that were used by XL C++.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109078

Files:
  clang/lib/Driver/ToolChains/AIX.cpp
  clang/lib/Driver/ToolChains/AIX.h
  clang/test/Driver/aix-ld.c
  clang/test/Driver/aix-toolchain-include.cpp

Index: clang/test/Driver/aix-toolchain-include.cpp
===
--- clang/test/Driver/aix-toolchain-include.cpp
+++ clang/test/Driver/aix-toolchain-include.cpp
@@ -5,13 +5,13 @@
 // RUN:		-target powerpc-ibm-aix \
 // RUN:		-resource-dir=%S/Inputs/resource_dir \
 // RUN:		--sysroot=%S/Inputs/basic_aix_tree \
-// RUN:   | FileCheck -check-prefix=CHECK-INTERNAL-INCLUDE %s
+// RUN:   | FileCheck -check-prefixes=CHECK-INTERNAL-INCLUDE,CHECK-INTERNAL-INCLUDE-CXX %s
 
 // RUN: %clangxx -### -no-canonical-prefixes %s 2>&1 \
 // RUN:		-target powerpc64-ibm-aix \
 // RUN:		-resource-dir=%S/Inputs/resource_dir \
 // RUN:		--sysroot=%S/Inputs/basic_aix_tree \
-// RUN:   | FileCheck -check-prefix=CHECK-INTERNAL-INCLUDE %s
+// RUN:   | FileCheck -check-prefixes=CHECK-INTERNAL-INCLUDE,CHECK-INTERNAL-INCLUDE-CXX %s
 
 // RUN: %clang -### -xc -no-canonical-prefixes %s 2>&1 \
 // RUN:		-target powerpc-ibm-aix \
@@ -25,11 +25,13 @@
 // RUN:		--sysroot=%S/Inputs/basic_aix_tree \
 // RUN:   | FileCheck -check-prefix=CHECK-INTERNAL-INCLUDE %s
 
-// CHECK-INTERNAL-INCLUDE:	{{.*}}clang{{.*}}" "-cc1"
-// CHECK-INTERNAL-INCLUDE:	"-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
-// CHECK-INTERNAL-INCLUDE:	"-isysroot" "[[SYSROOT:[^"]+]]"
-// CHECK-INTERNAL-INCLUDE:	"-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include"
-// CHECK-INTERNAL-INCLUDE:	"-internal-isystem" "[[SYSROOT]]/usr/include"
+// CHECK-INTERNAL-INCLUDE:  {{.*}}clang{{.*}}" "-cc1"
+// CHECK-INTERNAL-INCLUDE:  "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
+// CHECK-INTERNAL-INCLUDE:  "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-INTERNAL-INCLUDE-CXX:  "-internal-isystem" "[[SYSROOT]]/opt/IBM/openxlCSDK/include/c++/v1"
+// CHECK-INTERNAL-INCLUDE-CXX:  "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
+// CHECK-INTERNAL-INCLUDE:  "-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include"
+// CHECK-INTERNAL-INCLUDE:  "-internal-isystem" "[[SYSROOT]]/usr/include"
 
 // Check powerpc-ibm-aix, 32-bit/64-bit. -nostdinc option.
 // RUN: %clangxx -### -no-canonical-prefixes %s 2>&1 \
@@ -98,6 +100,8 @@
 // CHECK-NOSTDLIBINC-INCLUDE:	"-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
 // CHECK-NOSTDLIBINC-INCLUDE:	"-isysroot" "[[SYSROOT:[^"]+]]"
 // CHECK-NOSTDLIBINC-INCLUDE:	"-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include"
+// CHECK-NOSTDLIBINC-INCLUDE-NOT:  "-internal-isystem" "[[SYSROOT]]/opt/IBM/openxlCSDK/include/c++/v1"
+// CHECK-NOSTDLIBINC-INCLUDE-NOT:  "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
 // CHECK-NOSTDLIBINC-INCLUDE-NOT:	"-internal-isystem" "[[SYSROOT]]/usr/include"
 
 // Check powerpc-ibm-aix, 32-bit/64-bit. -nobuiltininc option.
@@ -106,14 +110,14 @@
 // RUN:		-resource-dir=%S/Inputs/resource_dir \
 // RUN:		--sysroot=%S/Inputs/basic_aix_tree \
 // RUN:		-nobuiltininc \
-// RUN:   | FileCheck -check-prefix=CHECK-NOBUILTININC-INCLUDE %s
+// RUN:   | FileCheck -check-prefixes=CHECK-NOBUILTININC-INCLUDE,CHECK-NOBUILTININC-INCLUDE-CXX %s
 
 // RUN: %clangxx -### -no-canonical-prefixes %s 2>&1 \
 // RUN:		-target powerpc64-ibm-aix \
 // RUN:		-resource-dir=%S/Inputs/resource_dir \
 // RUN:		--sysroot=%S/Inputs/basic_aix_tree \
 // RUN:		-nobuiltininc \
-// RUN:   | FileCheck -check-prefix=CHECK-NOBUILTININC-INCLUDE %s
+// RUN:   | FileCheck -check-prefixes=CHECK-NOBUILTININC-INCLUDE,CHECK-NOBUILTININC-INCLUDE-CXX  %s
 
 // RUN: %clang -### -xc -no-canonical-prefixes %s 2>&1 \
 // RUN:		-target powerpc-ibm-aix \
@@ -133,4 +137,45 @@
 // CHECK-NOBUILTININC-INCLUDE:	"-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
 // CHECK-NOBUILTININC-INCLUDE:	"-isysroot" "[[SYSROOT:[^"]+]]"
 // CHECK-NOBUILTININC-INCLUDE-NOT:	"-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include"
+// CHECK-NOBUILTININC-INCLUDE-CXX:  "-internal-isystem" "[[SYSROOT]]/opt/IBM/openxlCSDK/include/c++/v1"
+// CHECK-NOBUILTININC-INCLUDE-CXX:  "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
 // CHECK-NOBUILTININC-INCLUDE:	"-internal-isystem" "[[SYSROOT]]/usr/include"
+
+// Check powerpc-ibm-aix, 32-bit/64-bit. -nostdinc++ option.
+// RUN: %clangxx -### -no-canonical-prefixes %s 2>&1 \
+// RUN:  -target powerpc-ibm-aix \
+// RUN:  -resource-dir=%S/Inputs/resource_dir \
+// RUN:  --sysroot=%S/Inputs/basic_aix_tree \
+// RUN:  -nostdinc++ \
+// RUN:   | FileCheck -check-prefix=CHECK-NOSTDINCXX-INCLUDE %s
+
+/

[PATCH] D108360: [clang][NFC] Remove dead code

2021-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment.

In D108360#2962010 , @wingo wrote:

> @Anastasia is this good to go for you or does this need closer attention?

Yeah I agree that this code seems like a left-over from some refactoring as it 
seems to have no effect.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108360/new/

https://reviews.llvm.org/D108360

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


[PATCH] D108360: [clang][NFC] Remove dead code

2021-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.

LGTM! Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108360/new/

https://reviews.llvm.org/D108360

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


[PATCH] D107882: BPF: Enable frontend constant folding for VLA size

2021-09-01 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment.

I'd prefer not to mess with the AST if we don't need to; more differences 
between targets make it harder to understand any issues that come up.  
BPF-flavored C already has enough weird differences without adding unnecessary 
changes.

If all you need is to avoid unnecessary llvm.stacksave calls, can you try 
messing with CodeGenFunction::EmitAutoVarAlloca?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107882/new/

https://reviews.llvm.org/D107882

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


[PATCH] D107882: BPF: Enable frontend constant folding for VLA size

2021-09-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment.

@efriedma Thanks for suggestion! Let me look at 
CodeGenFunction::EmitAutoVarAlloca() call instead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107882/new/

https://reviews.llvm.org/D107882

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


[clang] 0173e02 - [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via cfe-commits

Author: Jon Chesterfield
Date: 2021-09-01T19:46:21+01:00
New Revision: 0173e024fd9e779a94503040a532bcf125277f86

URL: 
https://github.com/llvm/llvm-project/commit/0173e024fd9e779a94503040a532bcf125277f86
DIFF: 
https://github.com/llvm/llvm-project/commit/0173e024fd9e779a94503040a532bcf125277f86.diff

LOG: [openmp] Accept directory for libomptarget-bc-path

The commandline flag to specify a particular openmp devicertl library
currently errors like:
```
fatal error: cannot open file
  './runtimes/runtimes-bins/openmp/libomptarget':
  Is a directory
```
CommonArgs successfully appends the directory to the commandline args then
mlink-builtin-bitcode rejects it.

This patch is a point fix to that. If --libomptarget-amdgcn-bc-path=directory
then append the expected name for the current architecture and go on as before.
This is useful for test runners that don't hardcode the architecture.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D109057

Added: 


Modified: 
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/test/Driver/openmp-offload-gpu.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp 
b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 343a5d5f4cf78..7c7f4d63eca0d 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1709,22 +1709,26 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
 : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
+  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
+
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
-std::string LibOmpTargetName(A->getValue());
-if (llvm::sys::fs::exists(LibOmpTargetName)) {
+SmallString<128> LibOmpTargetFile(A->getValue());
+if (llvm::sys::fs::exists(LibOmpTargetFile) &&
+llvm::sys::fs::is_directory(LibOmpTargetFile)) {
+  llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
+}
+
+if (llvm::sys::fs::exists(LibOmpTargetFile)) {
   CC1Args.push_back("-mlink-builtin-bitcode");
-  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
+  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
 } else {
   D.Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
-  << LibOmpTargetName;
+  << LibOmpTargetFile;
 }
   } else {
 bool FoundBCLibrary = false;
 
-std::string LibOmpTargetName =
-"libomptarget-" + BitcodeSuffix.str() + ".bc";
-
 for (StringRef LibraryPath : LibraryPaths) {
   SmallString<128> LibOmpTargetFile(LibraryPath);
   llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);

diff  --git a/clang/test/Driver/openmp-offload-gpu.c 
b/clang/test/Driver/openmp-offload-gpu.c
index dafedfe70e069..d30ba2595f573 100644
--- a/clang/test/Driver/openmp-offload-gpu.c
+++ b/clang/test/Driver/openmp-offload-gpu.c
@@ -165,10 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
+// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget/libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###



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


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0173e024fd9e: [openmp] Accept directory for 
libomptarget-bc-path (authored by JonChesterfield).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/test/Driver/openmp-offload-gpu.c


Index: clang/test/Driver/openmp-offload-gpu.c
===
--- clang/test/Driver/openmp-offload-gpu.c
+++ clang/test/Driver/openmp-offload-gpu.c
@@ -165,10 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
+// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget/libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1709,22 +1709,26 @@
 : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
+  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
+
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
-std::string LibOmpTargetName(A->getValue());
-if (llvm::sys::fs::exists(LibOmpTargetName)) {
+SmallString<128> LibOmpTargetFile(A->getValue());
+if (llvm::sys::fs::exists(LibOmpTargetFile) &&
+llvm::sys::fs::is_directory(LibOmpTargetFile)) {
+  llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
+}
+
+if (llvm::sys::fs::exists(LibOmpTargetFile)) {
   CC1Args.push_back("-mlink-builtin-bitcode");
-  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
+  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
 } else {
   D.Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
-  << LibOmpTargetName;
+  << LibOmpTargetFile;
 }
   } else {
 bool FoundBCLibrary = false;
 
-std::string LibOmpTargetName =
-"libomptarget-" + BitcodeSuffix.str() + ".bc";
-
 for (StringRef LibraryPath : LibraryPaths) {
   SmallString<128> LibOmpTargetFile(LibraryPath);
   llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);


Index: clang/test/Driver/openmp-offload-gpu.c
===
--- clang/test/Driver/openmp-offload-gpu.c
+++ clang/test/Driver/openmp-offload-gpu.c
@@ -165,10 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_35 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
+// CHK-BCLIB-USER-DIR: clang{{.*}}-triple{{.*}}nvp

[clang] 3d157cf - [clang] Add a -canonical-prefixes option

2021-09-01 Thread Nico Weber via cfe-commits

Author: Nico Weber
Date: 2021-09-01T14:51:06-04:00
New Revision: 3d157cfcc4ef2b4e09a36d3249c960d0a4099ca7

URL: 
https://github.com/llvm/llvm-project/commit/3d157cfcc4ef2b4e09a36d3249c960d0a4099ca7
DIFF: 
https://github.com/llvm/llvm-project/commit/3d157cfcc4ef2b4e09a36d3249c960d0a4099ca7.diff

LOG: [clang] Add a -canonical-prefixes option

In https://reviews.llvm.org/D47480 I complained that there's no positive
form of this flag, so let's add one :)

https://gcc.gnu.org/PR29931 also has a pending patch to add the positive
form to gcc (but there's admittedly not a lot of movement on that bug).

This doesn't change any defaults.

Differential Revision: https://reviews.llvm.org/D108818

Added: 


Modified: 
clang/include/clang/Driver/Options.td
clang/lib/Driver/Driver.cpp
clang/test/Driver/no-canonical-prefixes.c
clang/tools/driver/driver.cpp

Removed: 




diff  --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 100e07b649c87..fa94c08c74e22 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -3677,8 +3677,10 @@ def multi__module : Flag<["-"], "multi_module">;
 def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
 def multiply__defined : Separate<["-"], "multiply_defined">;
 def mwarn_nonportable_cfstrings : Flag<["-"], "mwarn-nonportable-cfstrings">, 
Group;
+def canonical_prefixes : Flag<["-"], "canonical-prefixes">, Flags<[HelpHidden, 
CoreOption]>,
+  HelpText<"Use absolute paths for invoking subcommands (default)">;
 def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">, 
Flags<[HelpHidden, CoreOption]>,
-  HelpText<"Use relative instead of canonical paths">;
+  HelpText<"Use relative paths for invoking subcommands">;
 def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, 
Group;
 def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, 
Flags<[NoXarchOption]>;
 def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group;

diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 9dab045b1c9f1..82eacf27dcd7b 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -1091,7 +1091,8 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) {
   // Silence driver warnings if requested
   Diags.setIgnoreAllWarnings(Args.hasArg(options::OPT_w));
 
-  // -no-canonical-prefixes is used very early in main.
+  // -canonical-prefixes, -no-canonical-prefixes are used very early in main.
+  Args.ClaimAllArgs(options::OPT_canonical_prefixes);
   Args.ClaimAllArgs(options::OPT_no_canonical_prefixes);
 
   // f(no-)integated-cc1 is also used very early in main.

diff  --git a/clang/test/Driver/no-canonical-prefixes.c 
b/clang/test/Driver/no-canonical-prefixes.c
index c222dd4aa6cc7..fb54f85f959ae 100644
--- a/clang/test/Driver/no-canonical-prefixes.c
+++ b/clang/test/Driver/no-canonical-prefixes.c
@@ -10,8 +10,20 @@
 // RUN: rm -f %t.fake
 // RUN: ln -sf %t.real %t.fake
 // RUN: cd %t.fake
-// RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s
-// RUN: ./test-clang -v -S %s -no-canonical-prefixes 2>&1 | FileCheck 
--check-prefix=NON-CANONICAL %s
+// RUN: ./test-clang -v -S %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CANONICAL %s
+// RUN: ./test-clang -v -S %s 2>&1 \
+// RUN: -no-canonical-prefixes \
+// RUN: | FileCheck --check-prefix=NON-CANONICAL %s
+// RUN: ./test-clang -v -S %s 2>&1 \
+// RUN: -no-canonical-prefixes \
+// RUN: -canonical-prefixes \
+// RUN: | FileCheck --check-prefix=CANONICAL %s
+// RUN: ./test-clang -v -S %s 2>&1 \
+// RUN: -no-canonical-prefixes \
+// RUN: -canonical-prefixes \
+// RUN: -no-canonical-prefixes \
+// RUN: | FileCheck --check-prefix=NON-CANONICAL %s
 //
 // FIXME: This should really be '.real'.
 // CANONICAL: InstalledDir: {{.*}}.fake

diff  --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index 5a453429e79bf..2113c3d9cbaf7 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -416,10 +416,10 @@ int main(int Argc, const char **Argv) {
 // Skip end-of-line response file markers
 if (Args[i] == nullptr)
   continue;
-if (StringRef(Args[i]) == "-no-canonical-prefixes") {
+if (StringRef(Args[i]) == "-canonical-prefixes")
+  CanonicalPrefixes = true;
+else if (StringRef(Args[i]) == "-no-canonical-prefixes")
   CanonicalPrefixes = false;
-  break;
-}
   }
 
   // Handle CL and _CL_ which permits additional command line options to be



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


[PATCH] D108818: [clang] Add a -canonical-prefixes option

2021-09-01 Thread Nico Weber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3d157cfcc4ef: [clang] Add a -canonical-prefixes option 
(authored by thakis).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108818/new/

https://reviews.llvm.org/D108818

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/no-canonical-prefixes.c
  clang/tools/driver/driver.cpp


Index: clang/tools/driver/driver.cpp
===
--- clang/tools/driver/driver.cpp
+++ clang/tools/driver/driver.cpp
@@ -416,10 +416,10 @@
 // Skip end-of-line response file markers
 if (Args[i] == nullptr)
   continue;
-if (StringRef(Args[i]) == "-no-canonical-prefixes") {
+if (StringRef(Args[i]) == "-canonical-prefixes")
+  CanonicalPrefixes = true;
+else if (StringRef(Args[i]) == "-no-canonical-prefixes")
   CanonicalPrefixes = false;
-  break;
-}
   }
 
   // Handle CL and _CL_ which permits additional command line options to be
Index: clang/test/Driver/no-canonical-prefixes.c
===
--- clang/test/Driver/no-canonical-prefixes.c
+++ clang/test/Driver/no-canonical-prefixes.c
@@ -10,8 +10,20 @@
 // RUN: rm -f %t.fake
 // RUN: ln -sf %t.real %t.fake
 // RUN: cd %t.fake
-// RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s
-// RUN: ./test-clang -v -S %s -no-canonical-prefixes 2>&1 | FileCheck 
--check-prefix=NON-CANONICAL %s
+// RUN: ./test-clang -v -S %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CANONICAL %s
+// RUN: ./test-clang -v -S %s 2>&1 \
+// RUN: -no-canonical-prefixes \
+// RUN: | FileCheck --check-prefix=NON-CANONICAL %s
+// RUN: ./test-clang -v -S %s 2>&1 \
+// RUN: -no-canonical-prefixes \
+// RUN: -canonical-prefixes \
+// RUN: | FileCheck --check-prefix=CANONICAL %s
+// RUN: ./test-clang -v -S %s 2>&1 \
+// RUN: -no-canonical-prefixes \
+// RUN: -canonical-prefixes \
+// RUN: -no-canonical-prefixes \
+// RUN: | FileCheck --check-prefix=NON-CANONICAL %s
 //
 // FIXME: This should really be '.real'.
 // CANONICAL: InstalledDir: {{.*}}.fake
Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -1091,7 +1091,8 @@
   // Silence driver warnings if requested
   Diags.setIgnoreAllWarnings(Args.hasArg(options::OPT_w));
 
-  // -no-canonical-prefixes is used very early in main.
+  // -canonical-prefixes, -no-canonical-prefixes are used very early in main.
+  Args.ClaimAllArgs(options::OPT_canonical_prefixes);
   Args.ClaimAllArgs(options::OPT_no_canonical_prefixes);
 
   // f(no-)integated-cc1 is also used very early in main.
Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -3677,8 +3677,10 @@
 def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
 def multiply__defined : Separate<["-"], "multiply_defined">;
 def mwarn_nonportable_cfstrings : Flag<["-"], "mwarn-nonportable-cfstrings">, 
Group;
+def canonical_prefixes : Flag<["-"], "canonical-prefixes">, Flags<[HelpHidden, 
CoreOption]>,
+  HelpText<"Use absolute paths for invoking subcommands (default)">;
 def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">, 
Flags<[HelpHidden, CoreOption]>,
-  HelpText<"Use relative instead of canonical paths">;
+  HelpText<"Use relative paths for invoking subcommands">;
 def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, 
Group;
 def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, 
Flags<[NoXarchOption]>;
 def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group;


Index: clang/tools/driver/driver.cpp
===
--- clang/tools/driver/driver.cpp
+++ clang/tools/driver/driver.cpp
@@ -416,10 +416,10 @@
 // Skip end-of-line response file markers
 if (Args[i] == nullptr)
   continue;
-if (StringRef(Args[i]) == "-no-canonical-prefixes") {
+if (StringRef(Args[i]) == "-canonical-prefixes")
+  CanonicalPrefixes = true;
+else if (StringRef(Args[i]) == "-no-canonical-prefixes")
   CanonicalPrefixes = false;
-  break;
-}
   }
 
   // Handle CL and _CL_ which permits additional command line options to be
Index: clang/test/Driver/no-canonical-prefixes.c
===
--- clang/test/Driver/no-canonical-prefixes.c
+++ clang/test/Driver/no-canonical-prefixes.c
@@ -10,8 +10,20 @@
 // RUN: rm -f %t.fake
 // RUN: ln -sf %t.real %t.fake
 // RUN: cd %t.fake
-// RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s
-// RUN: ./test-clang -v -S %s -no-canonica

[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment.

This breaks tests on windows: http://45.33.8.238/win/44930/step_7.txt

Please take a look and revert if it takes a while to fix. Probably just need to 
optionally accept win slashiness in the test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

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


[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield updated this revision to Diff 370024.
JonChesterfield added a comment.

- rebase


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  openmp/libomptarget/test/lit.cfg


Index: openmp/libomptarget/test/lit.cfg
===
--- openmp/libomptarget/test/lit.cfg
+++ openmp/libomptarget/test/lit.cfg
@@ -92,6 +92,10 @@
 append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
 append_dynamic_library_path('LIBRARY_PATH', \
 config.omp_host_rtl_directory, ":")
+if config.libomptarget_current_target.startswith('amdgcn'):
+config.test_flags += " --libomptarget-amdgcn-bc-path=" + 
config.library_dir
+if config.libomptarget_current_target.startswith('nvptx'):
+config.test_flags += " --libomptarget-nvptx-bc-path=" + 
config.library_dir
 
 # substitutions
 # - for targets that exist in the system create the actual command.
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1688,18 +1688,8 @@
StringRef BitcodeSuffix,
const llvm::Triple &Triple) {
   SmallVector LibraryPaths;
-  // Add user defined library paths from LIBRARY_PATH.
-  llvm::Optional LibPath =
-  llvm::sys::Process::GetEnv("LIBRARY_PATH");
-  if (LibPath) {
-SmallVector Frags;
-const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
-llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr);
-for (StringRef Path : Frags)
-  LibraryPaths.emplace_back(Path.trim());
-  }
-
-  // Add path to lib / lib64 folder.
+
+  // Add path to clang lib / lib64 folder.
   SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir);
   llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
   LibraryPaths.emplace_back(DefaultLibPath.c_str());


Index: openmp/libomptarget/test/lit.cfg
===
--- openmp/libomptarget/test/lit.cfg
+++ openmp/libomptarget/test/lit.cfg
@@ -92,6 +92,10 @@
 append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
 append_dynamic_library_path('LIBRARY_PATH', \
 config.omp_host_rtl_directory, ":")
+if config.libomptarget_current_target.startswith('amdgcn'):
+config.test_flags += " --libomptarget-amdgcn-bc-path=" + config.library_dir
+if config.libomptarget_current_target.startswith('nvptx'):
+config.test_flags += " --libomptarget-nvptx-bc-path=" + config.library_dir
 
 # substitutions
 # - for targets that exist in the system create the actual command.
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1688,18 +1688,8 @@
StringRef BitcodeSuffix,
const llvm::Triple &Triple) {
   SmallVector LibraryPaths;
-  // Add user defined library paths from LIBRARY_PATH.
-  llvm::Optional LibPath =
-  llvm::sys::Process::GetEnv("LIBRARY_PATH");
-  if (LibPath) {
-SmallVector Frags;
-const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
-llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr);
-for (StringRef Path : Frags)
-  LibraryPaths.emplace_back(Path.trim());
-  }
-
-  // Add path to lib / lib64 folder.
+
+  // Add path to clang lib / lib64 folder.
   SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir);
   llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
   LibraryPaths.emplace_back(DefaultLibPath.c_str());
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment.

I suppose it require users to add a command line argument every time they want 
to build a program?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

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


[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7a228f872fbb: [openmp] No longer use LIBRARY_PATH to find 
devicertl (authored by JonChesterfield).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  openmp/libomptarget/test/lit.cfg


Index: openmp/libomptarget/test/lit.cfg
===
--- openmp/libomptarget/test/lit.cfg
+++ openmp/libomptarget/test/lit.cfg
@@ -92,6 +92,10 @@
 append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
 append_dynamic_library_path('LIBRARY_PATH', \
 config.omp_host_rtl_directory, ":")
+if config.libomptarget_current_target.startswith('amdgcn'):
+config.test_flags += " --libomptarget-amdgcn-bc-path=" + 
config.library_dir
+if config.libomptarget_current_target.startswith('nvptx'):
+config.test_flags += " --libomptarget-nvptx-bc-path=" + 
config.library_dir
 
 # substitutions
 # - for targets that exist in the system create the actual command.
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1688,18 +1688,8 @@
StringRef BitcodeSuffix,
const llvm::Triple &Triple) {
   SmallVector LibraryPaths;
-  // Add user defined library paths from LIBRARY_PATH.
-  llvm::Optional LibPath =
-  llvm::sys::Process::GetEnv("LIBRARY_PATH");
-  if (LibPath) {
-SmallVector Frags;
-const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
-llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr);
-for (StringRef Path : Frags)
-  LibraryPaths.emplace_back(Path.trim());
-  }
-
-  // Add path to lib / lib64 folder.
+
+  // Add path to clang lib / lib64 folder.
   SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir);
   llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
   LibraryPaths.emplace_back(DefaultLibPath.c_str());


Index: openmp/libomptarget/test/lit.cfg
===
--- openmp/libomptarget/test/lit.cfg
+++ openmp/libomptarget/test/lit.cfg
@@ -92,6 +92,10 @@
 append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
 append_dynamic_library_path('LIBRARY_PATH', \
 config.omp_host_rtl_directory, ":")
+if config.libomptarget_current_target.startswith('amdgcn'):
+config.test_flags += " --libomptarget-amdgcn-bc-path=" + config.library_dir
+if config.libomptarget_current_target.startswith('nvptx'):
+config.test_flags += " --libomptarget-nvptx-bc-path=" + config.library_dir
 
 # substitutions
 # - for targets that exist in the system create the actual command.
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1688,18 +1688,8 @@
StringRef BitcodeSuffix,
const llvm::Triple &Triple) {
   SmallVector LibraryPaths;
-  // Add user defined library paths from LIBRARY_PATH.
-  llvm::Optional LibPath =
-  llvm::sys::Process::GetEnv("LIBRARY_PATH");
-  if (LibPath) {
-SmallVector Frags;
-const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
-llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr);
-for (StringRef Path : Frags)
-  LibraryPaths.emplace_back(Path.trim());
-  }
-
-  // Add path to lib / lib64 folder.
+
+  // Add path to clang lib / lib64 folder.
   SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir);
   llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
   LibraryPaths.emplace_back(DefaultLibPath.c_str());
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 7a228f8 - [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Jon Chesterfield via cfe-commits

Author: Jon Chesterfield
Date: 2021-09-01T20:24:34+01:00
New Revision: 7a228f872fbbefa6a6eba1d51da192761879fcca

URL: 
https://github.com/llvm/llvm-project/commit/7a228f872fbbefa6a6eba1d51da192761879fcca
DIFF: 
https://github.com/llvm/llvm-project/commit/7a228f872fbbefa6a6eba1d51da192761879fcca.diff

LOG: [openmp] No longer use LIBRARY_PATH to find devicertl

Given D109057, change test runner to use the libomptarget-x-bc-path
argument instead of the LIBRARY_PATH environment variable to find the device
library.

Also drop the use of LIBRARY_PATH environment variable as it is far
too easy to pull in the device library from an unrelated toolchain by accident
with the current setup. No loss in flexibility to developers as the clang
commandline used here is still available.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D109061

Added: 


Modified: 
clang/lib/Driver/ToolChains/CommonArgs.cpp
openmp/libomptarget/test/lit.cfg

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp 
b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 7c7f4d63eca0d..fb1aea20acc33 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1688,18 +1688,8 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
StringRef BitcodeSuffix,
const llvm::Triple &Triple) {
   SmallVector LibraryPaths;
-  // Add user defined library paths from LIBRARY_PATH.
-  llvm::Optional LibPath =
-  llvm::sys::Process::GetEnv("LIBRARY_PATH");
-  if (LibPath) {
-SmallVector Frags;
-const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
-llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr);
-for (StringRef Path : Frags)
-  LibraryPaths.emplace_back(Path.trim());
-  }
-
-  // Add path to lib / lib64 folder.
+
+  // Add path to clang lib / lib64 folder.
   SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir);
   llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
   LibraryPaths.emplace_back(DefaultLibPath.c_str());

diff  --git a/openmp/libomptarget/test/lit.cfg 
b/openmp/libomptarget/test/lit.cfg
index d4f63dd6c6de2..b47e16c4be918 100644
--- a/openmp/libomptarget/test/lit.cfg
+++ b/openmp/libomptarget/test/lit.cfg
@@ -92,6 +92,10 @@ else: # Unices
 append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
 append_dynamic_library_path('LIBRARY_PATH', \
 config.omp_host_rtl_directory, ":")
+if config.libomptarget_current_target.startswith('amdgcn'):
+config.test_flags += " --libomptarget-amdgcn-bc-path=" + 
config.library_dir
+if config.libomptarget_current_target.startswith('nvptx'):
+config.test_flags += " --libomptarget-nvptx-bc-path=" + 
config.library_dir
 
 # substitutions
 # - for targets that exist in the system create the actual command.



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


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment.

In D109057#2977632 , @thakis wrote:

> This breaks tests on windows: http://45.33.8.238/win/44930/step_7.txt
>
> Please take a look and revert if it takes a while to fix. Probably just need 
> to optionally accept win slashiness in the test.

Ah, that explains the {{.*}} patterns. Will fix by dropping the 'libomptarget/' 
string as the important part is that it found the sm_35.bc in that directory


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

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


[clang] 88511f6 - [libomptarget] Drop path separator from test to fix windows build

2021-09-01 Thread Jon Chesterfield via cfe-commits

Author: Jon Chesterfield
Date: 2021-09-01T20:34:58+01:00
New Revision: 88511f6bc56792b47fb6e003f5357eff3b94717a

URL: 
https://github.com/llvm/llvm-project/commit/88511f6bc56792b47fb6e003f5357eff3b94717a
DIFF: 
https://github.com/llvm/llvm-project/commit/88511f6bc56792b47fb6e003f5357eff3b94717a.diff

LOG: [libomptarget] Drop path separator from test to fix windows build

Added: 


Modified: 
clang/test/Driver/openmp-offload-gpu.c

Removed: 




diff  --git a/clang/test/Driver/openmp-offload-gpu.c 
b/clang/test/Driver/openmp-offload-gpu.c
index d30ba2595f57..9f596a230d0b 100644
--- a/clang/test/Driver/openmp-offload-gpu.c
+++ b/clang/test/Driver/openmp-offload-gpu.c
@@ -175,7 +175,7 @@
 // CHK-BCLIB: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
-// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget/libomptarget-nvptx-sm_35.bc
+// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###



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


[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment.

Nope, works the same as it used to - looks relative to clang. However I think 
it's broken some CI machines


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

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


[clang] cef1199 - Revert "[openmp] No longer use LIBRARY_PATH to find devicertl"

2021-09-01 Thread Jon Chesterfield via cfe-commits

Author: Jon Chesterfield
Date: 2021-09-01T20:44:12+01:00
New Revision: cef1199686475c0c63ba63ddb56f46bc7866fa3e

URL: 
https://github.com/llvm/llvm-project/commit/cef1199686475c0c63ba63ddb56f46bc7866fa3e
DIFF: 
https://github.com/llvm/llvm-project/commit/cef1199686475c0c63ba63ddb56f46bc7866fa3e.diff

LOG: Revert "[openmp] No longer use LIBRARY_PATH to find devicertl"

This reverts commit 7a228f872fbbefa6a6eba1d51da192761879fcca.
Failing test case under CI

Added: 


Modified: 
clang/lib/Driver/ToolChains/CommonArgs.cpp
openmp/libomptarget/test/lit.cfg

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp 
b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index fb1aea20acc33..7c7f4d63eca0d 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1688,8 +1688,18 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
StringRef BitcodeSuffix,
const llvm::Triple &Triple) {
   SmallVector LibraryPaths;
-
-  // Add path to clang lib / lib64 folder.
+  // Add user defined library paths from LIBRARY_PATH.
+  llvm::Optional LibPath =
+  llvm::sys::Process::GetEnv("LIBRARY_PATH");
+  if (LibPath) {
+SmallVector Frags;
+const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
+llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr);
+for (StringRef Path : Frags)
+  LibraryPaths.emplace_back(Path.trim());
+  }
+
+  // Add path to lib / lib64 folder.
   SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir);
   llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
   LibraryPaths.emplace_back(DefaultLibPath.c_str());

diff  --git a/openmp/libomptarget/test/lit.cfg 
b/openmp/libomptarget/test/lit.cfg
index b47e16c4be918..d4f63dd6c6de2 100644
--- a/openmp/libomptarget/test/lit.cfg
+++ b/openmp/libomptarget/test/lit.cfg
@@ -92,10 +92,6 @@ else: # Unices
 append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
 append_dynamic_library_path('LIBRARY_PATH', \
 config.omp_host_rtl_directory, ":")
-if config.libomptarget_current_target.startswith('amdgcn'):
-config.test_flags += " --libomptarget-amdgcn-bc-path=" + 
config.library_dir
-if config.libomptarget_current_target.startswith('nvptx'):
-config.test_flags += " --libomptarget-nvptx-bc-path=" + 
config.library_dir
 
 # substitutions
 # - for targets that exist in the system create the actual command.



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


[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment.

In D109061#2977690 , @JonChesterfield 
wrote:

> Nope, works the same as it used to - looks relative to clang. However I think 
> it's broken some CI machines

Well, it also breaks when OpenMP is built standalone.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

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


[clang] 6b0636c - Revert "[openmp] Accept directory for libomptarget-bc-path"

2021-09-01 Thread Jon Chesterfield via cfe-commits

Author: Jon Chesterfield
Date: 2021-09-01T20:45:41+01:00
New Revision: 6b0636ce535efb8649e7cd01ccd03825fd63f8a2

URL: 
https://github.com/llvm/llvm-project/commit/6b0636ce535efb8649e7cd01ccd03825fd63f8a2
DIFF: 
https://github.com/llvm/llvm-project/commit/6b0636ce535efb8649e7cd01ccd03825fd63f8a2.diff

LOG: Revert "[openmp] Accept directory for libomptarget-bc-path"

Windows separator problem. Fixing that broke another regex.
This reverts commit 0173e024fd9e779a94503040a532bcf125277f86.

Added: 


Modified: 
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/test/Driver/openmp-offload-gpu.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp 
b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 7c7f4d63eca0d..343a5d5f4cf78 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1709,26 +1709,22 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
 : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
-  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
-
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
-SmallString<128> LibOmpTargetFile(A->getValue());
-if (llvm::sys::fs::exists(LibOmpTargetFile) &&
-llvm::sys::fs::is_directory(LibOmpTargetFile)) {
-  llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
-}
-
-if (llvm::sys::fs::exists(LibOmpTargetFile)) {
+std::string LibOmpTargetName(A->getValue());
+if (llvm::sys::fs::exists(LibOmpTargetName)) {
   CC1Args.push_back("-mlink-builtin-bitcode");
-  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
+  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
 } else {
   D.Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
-  << LibOmpTargetFile;
+  << LibOmpTargetName;
 }
   } else {
 bool FoundBCLibrary = false;
 
+std::string LibOmpTargetName =
+"libomptarget-" + BitcodeSuffix.str() + ".bc";
+
 for (StringRef LibraryPath : LibraryPaths) {
   SmallString<128> LibOmpTargetFile(LibraryPath);
   llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);

diff  --git a/clang/test/Driver/openmp-offload-gpu.c 
b/clang/test/Driver/openmp-offload-gpu.c
index 9f596a230d0ba..d4e1757162771 100644
--- a/clang/test/Driver/openmp-offload-gpu.c
+++ b/clang/test/Driver/openmp-offload-gpu.c
@@ -165,17 +165,11 @@
 // RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
-/// The user can also pass the path to the directory containing the bitcode lib
-// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
-// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
-// RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
-// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
-// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
-// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
+
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###



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


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment.

Bad times. Changing that to accept the / was a shotgun fix for the problem but 
it collides with one of the nearby regex, reverting while I work out what is 
going on


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

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


[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment.

From my perspective, using `LIBRARY_PATH` to find bitcode library conforms with 
convention because the library is linked in a linkage during compilation time, 
where `LIBRARY_PATH` is used by the linker. If we don't want to mess up test 
results, the patch to force `rpath` should do the right thing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

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


[PATCH] D102449: [WIP][Clang][OpenMP] Add the support for compare clause in atomic directive

2021-09-01 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment.

Another thing is how we deal with a corner case. Say the OpenMP code is written 
in the following way:

  #pragma omp atomic compare
x = e < x ? e : x;

That's how OpenMP spec defines the atomic operation. `x` is always in "else 
statement" of a conditional statement.

Now we need to lower it to LLVM IR, which is `atomicrmw` operation. Based on 
the LLVM IR reference, it only supports the atomic operations that `x` is in 
the "then statement". For example: `x = x > e ? x : e`. See the `x` here is 
before `:`. In order to lower the OpenMP statement, we have to do a 
transformation. In order to swap `e` and `x`, we need to transform it to `x = e 
>= x : x : e`, a.k.a. `x = x <= e : x : e`. However, we don't have an atomic 
operation for `<=`. We only have `<`. So if `x != e`, the result is good.

The incorrectness happens if `x == e`. Recall at the OpenMP statement, when `x 
== e`, the result should be `x = x`. But if we look at our lowered LLVM IR, `x 
= x < e : x : e`, when `x == e`, it becomes `x = e`, which doesn't conform with 
OpenMP spec.

What should we do here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102449/new/

https://reviews.llvm.org/D102449

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


[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment.

Using LIBRARY_PATH to find the bitcode is a reasonable interpretation of 
LIBRARY_PATH but it's a disaster in terms of using clang on a system that has 
LIBRARY_PATH pointing at some other version of clang. Rpath will be ignored by 
the bitcode lib handling.

How does this break under standalone? It uses the same config.variable that is 
used for LIBRARY_PATH at the moment, so it looks in exactly the same place as 
before this patch


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

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


[PATCH] D106343: [OpenCL] Support cl_ext_float_atomics

2021-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment.

In D106343#2974055 , @haonanya wrote:

> Hi, svenvh and Anastasia. If you approve the patch, could you please submit 
> it?
> I don't have permission to do it.

Sure, I can commit it on your behalf, `atomic_half` can be added separately. 
Thanks!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106343/new/

https://reviews.llvm.org/D106343

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


[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment.

In D109061#2977714 , @JonChesterfield 
wrote:

> Using LIBRARY_PATH to find the bitcode is a reasonable interpretation of 
> LIBRARY_PATH but it's a disaster in terms of using clang on a system that has 
> LIBRARY_PATH pointing at some other version of clang. Rpath will be ignored 
> by the bitcode lib handling.
>
> How does this break under standalone? It uses the same config.variable that 
> is used for LIBRARY_PATH at the moment, so it looks in exactly the same place 
> as before this patch

OpenMP libraries don't always sit next to `clang`'s default library path. For 
standalone build, the installation path of OpenMP can be different from that of 
LLVM. Before this patch, `clang` can find the library as long as `openmp/lib` 
is in `LIBRARY_PATH`. Now it can never find it except we pass the path 
explicitly to the compilation command line. I understand your argument that 
`clang` might find a wrong one, but it's user's responsibility to make sure the 
expected version should be on the top of `LIBRARY_PATH`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

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


[clang] 8976a1e - VFS: Document goals of 'use-external-name' and related logic, NFC

2021-09-01 Thread Duncan P . N . Exon Smith via cfe-commits

Author: Duncan P. N. Exon Smith
Date: 2021-09-01T15:55:33-04:00
New Revision: 8976a1e111393aab7b4965196364ad734a17f2d5

URL: 
https://github.com/llvm/llvm-project/commit/8976a1e111393aab7b4965196364ad734a17f2d5
DIFF: 
https://github.com/llvm/llvm-project/commit/8976a1e111393aab7b4965196364ad734a17f2d5.diff

LOG: VFS: Document goals of 'use-external-name' and related logic, NFC

Document 'use-external-name' and the various bits of logic that make it
work, to avoid others having to repeat the archival work (given that I
added getFileRefReturnsCorrectNameForDifferentStatPath to
FileManagerTest, seems possible I understood this once before!).

- b59cf679e81483cbb3a9252056b7528f4c49586c added 'use-external-name' to
  RedirectingFileSystem. This causes `stat`s to return the external
  name for a redirected file instead of the name it was accessed by,
  leaking it through the VFS.
- d066d4c849be06a01c0d17e8dc206913f4e7bfe3 propagated the external name
  further through clang::FileManager.
- 4dc5573acc0d2e7c59d8bac2543eb25cb4b32984, which added
  clang::FileEntryRef to clang::FileManager, has complicated concession
  to account for this as well (since refactored a bit).

The goal of 'use-external-name' is to enable Clang to report "real" file
paths to users (via diagnostics) and to external tools (such as
debuggers reading debug info and build systems reading `.d` files).

I've added FIXMEs to look at other channels for communicating the
external names, since the current implementation adds complexity to
FileManager and exposes an inconsistent interface to clients.

Besides that, the FileManager logic appears to be kicking in outside of
'use-external-name'. Seems that *some* vfs::FileSystem implementations
canonicalize some paths returned by `stat` in *some* cases (the bug
isn't fully understood yet). Volodymyr Sapsai is investigating, this at
least better documents what *is* understood.

Added: 


Modified: 
clang/lib/Basic/FileManager.cpp
clang/unittests/Basic/FileManagerTest.cpp
llvm/include/llvm/Support/VirtualFileSystem.h

Removed: 




diff  --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp
index 74cd2f295be60..c4eae6acd7b04 100644
--- a/clang/lib/Basic/FileManager.cpp
+++ b/clang/lib/Basic/FileManager.cpp
@@ -276,6 +276,18 @@ FileManager::getFileRef(StringRef Filename, bool openFile, 
bool CacheFailure) {
   } else {
 // Name mismatch. We need a redirect. First grab the actual entry we want
 // to return.
+//
+// This redirection logic intentionally leaks the external name of a
+// redirected file that uses 'use-external-name' in \a
+// vfs::RedirectionFileSystem. This allows clang to report the external
+// name to users (in diagnostics) and to tools that don't have access to
+// the VFS (in debug info and dependency '.d' files).
+//
+// FIXME: This is pretty complicated. It's also inconsistent with how
+// "real" filesystems behave and confuses parts of clang expect to see the
+// name-as-accessed on the \a FileEntryRef. Maybe the returned \a
+// FileEntryRef::getName() could return the accessed name unmodified, but
+// make the external name available via a separate API.
 auto &Redirection =
 *SeenFileEntries
  .insert({Status.getName(), FileEntryRef::MapValue(UFE, DirInfo)})

diff  --git a/clang/unittests/Basic/FileManagerTest.cpp 
b/clang/unittests/Basic/FileManagerTest.cpp
index 0a1f58f3bb90d..b40ba01121f8f 100644
--- a/clang/unittests/Basic/FileManagerTest.cpp
+++ b/clang/unittests/Basic/FileManagerTest.cpp
@@ -276,9 +276,9 @@ TEST_F(FileManagerTest, 
getFileReturnsSameFileEntryForAliasedRealFiles) {
 
 TEST_F(FileManagerTest, getFileRefReturnsCorrectNameForDifferentStatPath) {
   // Inject files with the same inode, but where some files have a stat that
-  // gives a 
diff erent name. This is adding coverage for weird stat behaviour
-  // triggered by the RedirectingFileSystem that FileManager::getFileRef has
-  // special logic for.
+  // gives a 
diff erent name. This is adding coverage for stat behaviour
+  // triggered by the RedirectingFileSystem for 'use-external-name' that
+  // FileManager::getFileRef has special logic for.
   auto StatCache = std::make_unique();
   StatCache->InjectDirectory("dir", 40);
   StatCache->InjectFile("dir/f1.cpp", 41);

diff  --git a/llvm/include/llvm/Support/VirtualFileSystem.h 
b/llvm/include/llvm/Support/VirtualFileSystem.h
index 323e6719645d9..e43da9c94f355 100644
--- a/llvm/include/llvm/Support/VirtualFileSystem.h
+++ b/llvm/include/llvm/Support/VirtualFileSystem.h
@@ -596,6 +596,17 @@ class RedirectingFileSystemParser;
 /// contain multiple path components (e.g. /path/to/file). However, any
 /// directory in such a path that contains more than one child must be uniquely
 /// represented by a 'directory' entry.
+///
+/// When the 'use-external-name' field i

[PATCH] D108886: Add RISC-V sifive-s51 cpu

2021-09-01 Thread Alexander Pivovarov via Phabricator via cfe-commits
apivovarov added a subscriber: kito.cheng.
apivovarov added a comment.

@evandro @kito-cheng @kito.cheng @khchen @MaskRay Could you review this patch? 
Thank you


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108886/new/

https://reviews.llvm.org/D108886

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


[PATCH] D108886: Add RISC-V sifive-s51 cpu

2021-09-01 Thread Jessica Clarke via Phabricator via cfe-commits
jrtc27 added a comment.

In D108886#2977730 , @apivovarov 
wrote:

> @evandro @kito-cheng @kito.cheng @khchen @MaskRay Could you review this 
> patch? Thank you

You don't need to tag people as well as adding them as reviewers, it's just 
annoying. Also, it's only been four days; the developer policy is that for 
non-urgent patches you shouldn't ping more than once a week.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108886/new/

https://reviews.llvm.org/D108886

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


[PATCH] D102449: [WIP][Clang][OpenMP] Add the support for compare clause in atomic directive

2021-09-01 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 370036.
tianshilei1992 added a comment.

rebase


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102449/new/

https://reviews.llvm.org/D102449

Files:
  clang/include/clang/AST/OpenMPClause.h
  clang/include/clang/AST/RecursiveASTVisitor.h
  clang/include/clang/AST/StmtOpenMP.h
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/OpenMPClause.cpp
  clang/lib/AST/StmtOpenMP.cpp
  clang/lib/AST/StmtProfile.cpp
  clang/lib/Basic/OpenMPKinds.cpp
  clang/lib/CodeGen/CGStmtOpenMP.cpp
  clang/lib/Parse/ParseOpenMP.cpp
  clang/lib/Sema/SemaOpenMP.cpp
  clang/lib/Sema/TreeTransform.h
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/ASTWriter.cpp
  clang/test/OpenMP/atomic_compare_codegen.cpp
  clang/tools/libclang/CIndex.cpp
  llvm/include/llvm/Frontend/OpenMP/OMP.td

Index: llvm/include/llvm/Frontend/OpenMP/OMP.td
===
--- llvm/include/llvm/Frontend/OpenMP/OMP.td
+++ llvm/include/llvm/Frontend/OpenMP/OMP.td
@@ -160,6 +160,7 @@
 def OMPC_Write : Clause<"write"> { let clangClass = "OMPWriteClause"; }
 def OMPC_Update : Clause<"update"> { let clangClass = "OMPUpdateClause"; }
 def OMPC_Capture : Clause<"capture"> { let clangClass = "OMPCaptureClause"; }
+def OMPC_Compare : Clause<"compare"> { let clangClass = "OMPCompareClause"; }
 def OMPC_SeqCst : Clause<"seq_cst"> { let clangClass = "OMPSeqCstClause"; }
 def OMPC_AcqRel : Clause<"acq_rel"> { let clangClass = "OMPAcqRelClause"; }
 def OMPC_Acquire : Clause<"acquire"> { let clangClass = "OMPAcquireClause"; }
@@ -500,6 +501,7 @@
 VersionedClause,
 VersionedClause,
 VersionedClause,
+VersionedClause
   ];
   let allowedOnceClauses = [
 VersionedClause,
Index: clang/tools/libclang/CIndex.cpp
===
--- clang/tools/libclang/CIndex.cpp
+++ clang/tools/libclang/CIndex.cpp
@@ -2271,6 +2271,8 @@
 
 void OMPClauseEnqueue::VisitOMPCaptureClause(const OMPCaptureClause *) {}
 
+void OMPClauseEnqueue::VisitOMPCompareClause(const OMPCompareClause *) {}
+
 void OMPClauseEnqueue::VisitOMPSeqCstClause(const OMPSeqCstClause *) {}
 
 void OMPClauseEnqueue::VisitOMPAcqRelClause(const OMPAcqRelClause *) {}
Index: clang/test/OpenMP/atomic_compare_codegen.cpp
===
--- /dev/null
+++ clang/test/OpenMP/atomic_compare_codegen.cpp
@@ -0,0 +1,374 @@
+
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -target-cpu core2 -fopenmp -fopenmp-version=51 -x c -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c -triple x86_64-apple-darwin10 -target-cpu core2 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c -triple x86_64-apple-darwin10 -target-cpu core2 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -target-cpu core2 -fopenmp-simd -fopenmp-version=51 -x c -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c -triple x86_64-apple-darwin10 -target-cpu core2 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c -triple x86_64-apple-darwin10 -target-cpu core2 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+// Integral types
+char cx, ce, cd;
+unsigned char ucx, uce, ucd;
+short sx, se, sd;
+unsigned short usx, use, usd;
+int ix, ie, id;
+unsigned int uix, uie, uid;
+long lx, le, ld;
+unsigned long ulx, ule, uld;
+long long llx, lle, lld;
+unsigned long long ullx, ulle, ulld;
+
+void foo() {
+// char
+// {
+
+#pragma omp atomic compare
+  cx = ce > cx ? ce : cx;
+
+#pragma omp atomic compare
+  cx = ce < cx ? ce : cx;
+
+#pragma omp atomic compare
+  cx = cx > ce ? ce : cx;
+
+#pragma omp atomic compare
+  cx = cx < ce ? ce : cx;
+
+#pragma omp atomic compare
+  cx = cx == ce ? cd : cx;
+
+#pragma omp atomic compare
+  if (ce > cx) { cx = ce; }
+
+#pragma omp atomic compare
+  if (ce < cx) { cx = ce; }
+
+#pragma omp atomic compare
+  if (cx > ce) { cx = ce; }
+
+#pragma omp atomic compare
+  if (cx < ce) { cx = ce; }
+
+#pragma omp atomic compare
+  if (cx == ce) { cx = cd; }
+
+// }
+
+// unsigned char
+// {
+
+#pragma omp atomic compare
+  ucx = uce > ucx ? uce : ucx;
+
+#pragma omp atomic compare
+  ucx = uce < ucx ? uce : ucx;
+
+#pragma omp atomic compare
+  ucx = ucx > uce ? uce : ucx;
+
+#pragma omp atomic compare
+  ucx = ucx < uce ? uce : ucx;
+
+#pragma omp atomic compare
+  ucx = ucx == uce ? ucd : ucx;
+
+#pragma omp atomic compare
+  if (uce > ucx) { ucx = uce; }
+
+#pragma omp atomic compare
+  if (uce < ucx) { ucx = uce; }
+
+#pragma omp atomic compare
+  if (ucx > uce) { ucx = uce; }
+
+#pragma omp atomic comp

[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment.

That helps disambiguate. You aren't concerned that this change will break the 
in tree tests, rather that people who currently rely on LIBRARY_PATH to choose 
a bitcode library to use with a clang located somewhere else in the filesystem 
will now need to pass --libomptarget-nvptx-bc-path instead, or put a symlink 
relative to clang.

That is a huge win for anyone who has LIBRARY_PATH pointing to one toolchain 
and who wants to be able to use clang from another as it replaces 
(non-diagnosed) runtime misbehaviour with a compile time error about being 
unable to find the devicertl. E.g. if they've had to set LIBRARY_PATH to find 
something their application uses that is unrelated to that clang, perhaps a 
vendor toolchain.

It's also a moderate win in that it hopefully dissuades people from assuming 
that any clang can be used with any openmp offloading library, which is very 
much not true.

It breaks the use case of people who have an exactly matching clang and openmp, 
that they installed in unrelated places, and use LIBRARY_PATH to stitch back 
together because they don't have to use it for anything else. They get to use 
the commandline arguments instead.

I think that's great all around. It makes it much less likely that people will 
mismatch clang and devicertl, which is good for UX and for our bug handling. If 
we need to preserve the environment plumbing then let's have a new variable 
named for the purpose, so that it doesn't collide with LIBRARY_PATH, and still 
wire tests together with the commandline argument as it lets people copy & 
paste the failing line into a new terminal to debug it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

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


[PATCH] D108886: Add RISC-V sifive-s51 cpu

2021-09-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment.

Looks reasonable. You can add a bullet point to clang/docs/ReleaseNotes.rst


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108886/new/

https://reviews.llvm.org/D108886

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


[PATCH] D109085: clang/win: Add __readfsdword to intrin.h

2021-09-01 Thread Nico Weber via Phabricator via cfe-commits
thakis created this revision.
thakis added a reviewer: hans.
Herald added a subscriber: pengfei.
thakis requested review of this revision.

When using __readfsdword(), clang used to warn that one has
to include  -- no matter if that was already included
or not.

Now it only warns if it's not yet included.

To verify that this was the only intrin with this problem, I ran:

  $ for f in $(grep intrin.h clang/include/clang/Basic/BuiltinsX86* |
   egrep -o '\([^,]+,' | egrep -o '[^(,]*'); do
  if ! grep -q $f clang/lib/Headers/intrin.h; then echo $f; fi;
done

This printed 9 more functions, but those are all in emmintrin.h,
xsaveintrin.h (which are included by intrin.h based on /arch: flags).
So this is indeed the only built-in that was missing in intrin.h.

Fixes PR51188.


https://reviews.llvm.org/D109085

Files:
  clang/lib/Headers/intrin.h
  clang/test/CodeGen/X86/ms-x86-intrinsics.c


Index: clang/test/CodeGen/X86/ms-x86-intrinsics.c
===
--- clang/test/CodeGen/X86/ms-x86-intrinsics.c
+++ clang/test/CodeGen/X86/ms-x86-intrinsics.c
@@ -1,10 +1,12 @@
-// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility 
-fms-compatibility-version=17.00 \
+// RUN: %clang_cc1 -Werror -ffreestanding -fms-extensions -fms-compatibility 
-fms-compatibility-version=17.00 \
 // RUN: -triple i686--windows -Oz -emit-llvm %s -o - \
 // RUN: | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-I386
-// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility 
-fms-compatibility-version=17.00 \
+// RUN: %clang_cc1 -Werror -ffreestanding -fms-extensions -fms-compatibility 
-fms-compatibility-version=17.00 \
 // RUN: -triple x86_64--windows -Oz -emit-llvm %s -o - \
 // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-X64
 
+#include 
+
 #if defined(__i386__)
 char test__readfsbyte(unsigned long Offset) {
   return __readfsbyte(++Offset);
Index: clang/lib/Headers/intrin.h
===
--- clang/lib/Headers/intrin.h
+++ clang/lib/Headers/intrin.h
@@ -97,8 +97,9 @@
 unsigned int __readdr(unsigned int);
 #ifdef __i386__
 unsigned char __readfsbyte(unsigned long);
-unsigned __int64 __readfsqword(unsigned long);
 unsigned short __readfsword(unsigned long);
+unsigned long __readfsdword(unsigned long);
+unsigned __int64 __readfsqword(unsigned long);
 #endif
 unsigned __int64 __readmsr(unsigned long);
 unsigned __int64 __readpmc(unsigned long);


Index: clang/test/CodeGen/X86/ms-x86-intrinsics.c
===
--- clang/test/CodeGen/X86/ms-x86-intrinsics.c
+++ clang/test/CodeGen/X86/ms-x86-intrinsics.c
@@ -1,10 +1,12 @@
-// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
+// RUN: %clang_cc1 -Werror -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
 // RUN: -triple i686--windows -Oz -emit-llvm %s -o - \
 // RUN: | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-I386
-// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
+// RUN: %clang_cc1 -Werror -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
 // RUN: -triple x86_64--windows -Oz -emit-llvm %s -o - \
 // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-X64
 
+#include 
+
 #if defined(__i386__)
 char test__readfsbyte(unsigned long Offset) {
   return __readfsbyte(++Offset);
Index: clang/lib/Headers/intrin.h
===
--- clang/lib/Headers/intrin.h
+++ clang/lib/Headers/intrin.h
@@ -97,8 +97,9 @@
 unsigned int __readdr(unsigned int);
 #ifdef __i386__
 unsigned char __readfsbyte(unsigned long);
-unsigned __int64 __readfsqword(unsigned long);
 unsigned short __readfsword(unsigned long);
+unsigned long __readfsdword(unsigned long);
+unsigned __int64 __readfsqword(unsigned long);
 #endif
 unsigned __int64 __readmsr(unsigned long);
 unsigned __int64 __readpmc(unsigned long);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] c7cbf1a - [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via cfe-commits

Author: Jon Chesterfield
Date: 2021-09-01T21:22:35+01:00
New Revision: c7cbf1a03ea6f624be54370ea7b571842bc67dda

URL: 
https://github.com/llvm/llvm-project/commit/c7cbf1a03ea6f624be54370ea7b571842bc67dda
DIFF: 
https://github.com/llvm/llvm-project/commit/c7cbf1a03ea6f624be54370ea7b571842bc67dda.diff

LOG: [openmp] Accept directory for libomptarget-bc-path

The commandline flag to specify a particular openmp devicertl library
currently errors like:
```
fatal error: cannot open file
  './runtimes/runtimes-bins/openmp/libomptarget':
  Is a directory
```
CommonArgs successfully appends the directory to the commandline args then
mlink-builtin-bitcode rejects it.

This patch is a point fix to that. If --libomptarget-amdgcn-bc-path=directory
then append the expected name for the current architecture and go on as before.
This is useful for test runners that don't hardcode the architecture.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D109057

Added: 


Modified: 
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/test/Driver/openmp-offload-gpu.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp 
b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 343a5d5f4cf78..7c7f4d63eca0d 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1709,22 +1709,26 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
 : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
+  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
+
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
-std::string LibOmpTargetName(A->getValue());
-if (llvm::sys::fs::exists(LibOmpTargetName)) {
+SmallString<128> LibOmpTargetFile(A->getValue());
+if (llvm::sys::fs::exists(LibOmpTargetFile) &&
+llvm::sys::fs::is_directory(LibOmpTargetFile)) {
+  llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
+}
+
+if (llvm::sys::fs::exists(LibOmpTargetFile)) {
   CC1Args.push_back("-mlink-builtin-bitcode");
-  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
+  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
 } else {
   D.Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
-  << LibOmpTargetName;
+  << LibOmpTargetFile;
 }
   } else {
 bool FoundBCLibrary = false;
 
-std::string LibOmpTargetName =
-"libomptarget-" + BitcodeSuffix.str() + ".bc";
-
 for (StringRef LibraryPath : LibraryPaths) {
   SmallString<128> LibOmpTargetFile(LibraryPath);
   llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);

diff  --git a/clang/test/Driver/openmp-offload-gpu.c 
b/clang/test/Driver/openmp-offload-gpu.c
index d4e1757162771..1c7316851d153 100644
--- a/clang/test/Driver/openmp-offload-gpu.c
+++ b/clang/test/Driver/openmp-offload-gpu.c
@@ -165,11 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
-
+// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget{{.}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###



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


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc7cbf1a03ea6: [openmp] Accept directory for 
libomptarget-bc-path (authored by JonChesterfield).

Changed prior to commit:
  https://reviews.llvm.org/D109057?vs=370006&id=370040#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/test/Driver/openmp-offload-gpu.c


Index: clang/test/Driver/openmp-offload-gpu.c
===
--- clang/test/Driver/openmp-offload-gpu.c
+++ clang/test/Driver/openmp-offload-gpu.c
@@ -165,11 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
-
+// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget{{.}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1709,22 +1709,26 @@
 : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
+  std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
+
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
-std::string LibOmpTargetName(A->getValue());
-if (llvm::sys::fs::exists(LibOmpTargetName)) {
+SmallString<128> LibOmpTargetFile(A->getValue());
+if (llvm::sys::fs::exists(LibOmpTargetFile) &&
+llvm::sys::fs::is_directory(LibOmpTargetFile)) {
+  llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
+}
+
+if (llvm::sys::fs::exists(LibOmpTargetFile)) {
   CC1Args.push_back("-mlink-builtin-bitcode");
-  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
+  CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
 } else {
   D.Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
-  << LibOmpTargetName;
+  << LibOmpTargetFile;
 }
   } else {
 bool FoundBCLibrary = false;
 
-std::string LibOmpTargetName =
-"libomptarget-" + BitcodeSuffix.str() + ".bc";
-
 for (StringRef LibraryPath : LibraryPaths) {
   SmallString<128> LibOmpTargetFile(LibraryPath);
   llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);


Index: clang/test/Driver/openmp-offload-gpu.c
===
--- clang/test/Driver/openmp-offload-gpu.c
+++ clang/test/Driver/openmp-offload-gpu.c
@@ -165,11 +165,17 @@
 // RUN:   -Xopenmp-target -march=sm_35 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
+/// The user can also pass the path to the directory containing the bitcode lib
+// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
+// RUN:   -Xopenmp-target -march=sm_35 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
+// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
-
+// CHK-BCLIB-

[PATCH] D108917: [AIX][PowerPC] Define __powerpc and __PPC macros

2021-09-01 Thread Chris Bowler via Phabricator via cfe-commits
cebowleratibm accepted this revision.
cebowleratibm added a comment.
This revision is now accepted and ready to land.

LGTM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108917/new/

https://reviews.llvm.org/D108917

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


[PATCH] D109085: clang/win: Add __readfsdword to intrin.h

2021-09-01 Thread Nico Weber via Phabricator via cfe-commits
thakis updated this revision to Diff 370041.
thakis added a comment.

no-op rebase in the hope that the precommit bot doesn't run in a "git lockfile 
already held" error again


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109085/new/

https://reviews.llvm.org/D109085

Files:
  clang/lib/Headers/intrin.h
  clang/test/CodeGen/X86/ms-x86-intrinsics.c


Index: clang/test/CodeGen/X86/ms-x86-intrinsics.c
===
--- clang/test/CodeGen/X86/ms-x86-intrinsics.c
+++ clang/test/CodeGen/X86/ms-x86-intrinsics.c
@@ -1,10 +1,12 @@
-// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility 
-fms-compatibility-version=17.00 \
+// RUN: %clang_cc1 -Werror -ffreestanding -fms-extensions -fms-compatibility 
-fms-compatibility-version=17.00 \
 // RUN: -triple i686--windows -Oz -emit-llvm %s -o - \
 // RUN: | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-I386
-// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility 
-fms-compatibility-version=17.00 \
+// RUN: %clang_cc1 -Werror -ffreestanding -fms-extensions -fms-compatibility 
-fms-compatibility-version=17.00 \
 // RUN: -triple x86_64--windows -Oz -emit-llvm %s -o - \
 // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-X64
 
+#include 
+
 #if defined(__i386__)
 char test__readfsbyte(unsigned long Offset) {
   return __readfsbyte(++Offset);
Index: clang/lib/Headers/intrin.h
===
--- clang/lib/Headers/intrin.h
+++ clang/lib/Headers/intrin.h
@@ -97,8 +97,9 @@
 unsigned int __readdr(unsigned int);
 #ifdef __i386__
 unsigned char __readfsbyte(unsigned long);
-unsigned __int64 __readfsqword(unsigned long);
 unsigned short __readfsword(unsigned long);
+unsigned long __readfsdword(unsigned long);
+unsigned __int64 __readfsqword(unsigned long);
 #endif
 unsigned __int64 __readmsr(unsigned long);
 unsigned __int64 __readpmc(unsigned long);


Index: clang/test/CodeGen/X86/ms-x86-intrinsics.c
===
--- clang/test/CodeGen/X86/ms-x86-intrinsics.c
+++ clang/test/CodeGen/X86/ms-x86-intrinsics.c
@@ -1,10 +1,12 @@
-// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
+// RUN: %clang_cc1 -Werror -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
 // RUN: -triple i686--windows -Oz -emit-llvm %s -o - \
 // RUN: | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-I386
-// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
+// RUN: %clang_cc1 -Werror -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
 // RUN: -triple x86_64--windows -Oz -emit-llvm %s -o - \
 // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-X64
 
+#include 
+
 #if defined(__i386__)
 char test__readfsbyte(unsigned long Offset) {
   return __readfsbyte(++Offset);
Index: clang/lib/Headers/intrin.h
===
--- clang/lib/Headers/intrin.h
+++ clang/lib/Headers/intrin.h
@@ -97,8 +97,9 @@
 unsigned int __readdr(unsigned int);
 #ifdef __i386__
 unsigned char __readfsbyte(unsigned long);
-unsigned __int64 __readfsqword(unsigned long);
 unsigned short __readfsword(unsigned long);
+unsigned long __readfsdword(unsigned long);
+unsigned __int64 __readfsqword(unsigned long);
 #endif
 unsigned __int64 __readmsr(unsigned long);
 unsigned __int64 __readpmc(unsigned long);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D109061: [openmp] No longer use LIBRARY_PATH to find devicertl

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield updated this revision to Diff 370047.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109061/new/

https://reviews.llvm.org/D109061

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  openmp/libomptarget/test/lit.cfg


Index: openmp/libomptarget/test/lit.cfg
===
--- openmp/libomptarget/test/lit.cfg
+++ openmp/libomptarget/test/lit.cfg
@@ -89,9 +89,10 @@
 config.test_flags += " -Wl,-rpath," + config.omp_host_rtl_directory
 if config.cuda_libdir:
 config.test_flags += " -Wl,-rpath," + config.cuda_libdir
-append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
-append_dynamic_library_path('LIBRARY_PATH', \
-config.omp_host_rtl_directory, ":")
+if config.libomptarget_current_target.startswith('amdgcn'):
+config.test_flags += " --libomptarget-amdgcn-bc-path=" + 
config.library_dir
+if config.libomptarget_current_target.startswith('nvptx'):
+config.test_flags += " --libomptarget-nvptx-bc-path=" + 
config.library_dir
 
 # substitutions
 # - for targets that exist in the system create the actual command.
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1688,18 +1688,8 @@
StringRef BitcodeSuffix,
const llvm::Triple &Triple) {
   SmallVector LibraryPaths;
-  // Add user defined library paths from LIBRARY_PATH.
-  llvm::Optional LibPath =
-  llvm::sys::Process::GetEnv("LIBRARY_PATH");
-  if (LibPath) {
-SmallVector Frags;
-const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
-llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr);
-for (StringRef Path : Frags)
-  LibraryPaths.emplace_back(Path.trim());
-  }
-
-  // Add path to lib / lib64 folder.
+
+  // Add path to clang lib / lib64 folder.
   SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir);
   llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
   LibraryPaths.emplace_back(DefaultLibPath.c_str());


Index: openmp/libomptarget/test/lit.cfg
===
--- openmp/libomptarget/test/lit.cfg
+++ openmp/libomptarget/test/lit.cfg
@@ -89,9 +89,10 @@
 config.test_flags += " -Wl,-rpath," + config.omp_host_rtl_directory
 if config.cuda_libdir:
 config.test_flags += " -Wl,-rpath," + config.cuda_libdir
-append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
-append_dynamic_library_path('LIBRARY_PATH', \
-config.omp_host_rtl_directory, ":")
+if config.libomptarget_current_target.startswith('amdgcn'):
+config.test_flags += " --libomptarget-amdgcn-bc-path=" + config.library_dir
+if config.libomptarget_current_target.startswith('nvptx'):
+config.test_flags += " --libomptarget-nvptx-bc-path=" + config.library_dir
 
 # substitutions
 # - for targets that exist in the system create the actual command.
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1688,18 +1688,8 @@
StringRef BitcodeSuffix,
const llvm::Triple &Triple) {
   SmallVector LibraryPaths;
-  // Add user defined library paths from LIBRARY_PATH.
-  llvm::Optional LibPath =
-  llvm::sys::Process::GetEnv("LIBRARY_PATH");
-  if (LibPath) {
-SmallVector Frags;
-const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
-llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr);
-for (StringRef Path : Frags)
-  LibraryPaths.emplace_back(Path.trim());
-  }
-
-  // Add path to lib / lib64 folder.
+
+  // Add path to clang lib / lib64 folder.
   SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir);
   llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
   LibraryPaths.emplace_back(DefaultLibPath.c_str());
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 06cdf48 - [openmp] Drop test from D109057, disproportionately difficult to run on windows

2021-09-01 Thread Jon Chesterfield via cfe-commits

Author: Jon Chesterfield
Date: 2021-09-01T21:51:51+01:00
New Revision: 06cdf48a0d94749a19b0b7075a8baf9d979bb409

URL: 
https://github.com/llvm/llvm-project/commit/06cdf48a0d94749a19b0b7075a8baf9d979bb409
DIFF: 
https://github.com/llvm/llvm-project/commit/06cdf48a0d94749a19b0b7075a8baf9d979bb409.diff

LOG: [openmp] Drop test from D109057, disproportionately difficult to run on 
windows

Added: 


Modified: 
clang/test/Driver/openmp-offload-gpu.c

Removed: 




diff  --git a/clang/test/Driver/openmp-offload-gpu.c 
b/clang/test/Driver/openmp-offload-gpu.c
index 1c7316851d15..d4e175716277 100644
--- a/clang/test/Driver/openmp-offload-gpu.c
+++ b/clang/test/Driver/openmp-offload-gpu.c
@@ -165,17 +165,11 @@
 // RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER %s
-/// The user can also pass the path to the directory containing the bitcode lib
-// RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
-// RUN:   --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget \
-// RUN:   -Xopenmp-target -march=sm_35 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
-// RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 
2>&1 \
-// RUN:   | FileCheck -check-prefix=CHK-BCLIB-USER-DIR %s
 
 // CHK-BCLIB: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
 // CHK-BCLIB-NEW: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-new-nvptx-sm_35.bc
 // CHK-BCLIB-USER: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
-// CHK-BCLIB-USER-DIR: 
clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget{{.}}libomptarget-nvptx-sm_35.bc
+
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###



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


[PATCH] D109057: [openmp] Accept directory for libomptarget-bc-path

2021-09-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment.

Turns out {{.}} is also fine as far as Linux is concerned and unacceptable to 
Windows. I can't run anything on Windows locally, and trial and error while 
watching http://45.33.8.238/win has taken too many iterations already, so I've 
dropped the test case in 06cdf48a0d94749a19b0b 
.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109057/new/

https://reviews.llvm.org/D109057

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


[PATCH] D108886: Add RISC-V sifive-s51 cpu

2021-09-01 Thread Alexander Pivovarov via Phabricator via cfe-commits
apivovarov added a comment.

In D108886#2977733 , @jrtc27 wrote:

> You don't need to tag people as well as adding them as reviewers, it's just 
> annoying. Also, it's only been four days; the developer policy is that for 
> non-urgent patches you shouldn't ping more than once a week.

Jessica, Contributing to LLVM says - To make sure the right people see your 
patch, please select suitable reviewers and add them to your patch when 
requesting a review. Suitable reviewers are the code owner (see 
CODE_OWNERS.txt) and other people doing work in the area your patch touches.

The people I added as reviewers contributes to RISC-V target code in the past.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108886/new/

https://reviews.llvm.org/D108886

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


  1   2   >