[llvm-branch-commits] [flang] ba485d5 - Link against libclang-cpp.so

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Tom Stellard
Date: 2021-08-09T23:57:11-07:00
New Revision: ba485d5bd56fd00e2e12522e76788bc52a87a4a9

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

LOG: Link against libclang-cpp.so

Added: 


Modified: 
flang/lib/Frontend/CMakeLists.txt
flang/lib/FrontendTool/CMakeLists.txt
flang/tools/flang-driver/CMakeLists.txt
flang/unittests/Frontend/CMakeLists.txt

Removed: 




diff  --git a/flang/lib/Frontend/CMakeLists.txt 
b/flang/lib/Frontend/CMakeLists.txt
index abaa77f6af54d..0f40f1d97f937 100644
--- a/flang/lib/Frontend/CMakeLists.txt
+++ b/flang/lib/Frontend/CMakeLists.txt
@@ -9,7 +9,7 @@ add_flang_library(flangFrontend
   TextDiagnostic.cpp
 
   DEPENDS
-  clangBasic
+  clang-cpp
 
   LINK_LIBS
   FortranParser
@@ -17,8 +17,7 @@ add_flang_library(flangFrontend
   FortranEvaluate
   FortranCommon
   FortranLower
-  clangBasic
-  clangDriver
+  clang-cpp
 
   LINK_COMPONENTS
   Option

diff  --git a/flang/lib/FrontendTool/CMakeLists.txt 
b/flang/lib/FrontendTool/CMakeLists.txt
index 65e1dd5188ac6..e9e1bba122c6f 100644
--- a/flang/lib/FrontendTool/CMakeLists.txt
+++ b/flang/lib/FrontendTool/CMakeLists.txt
@@ -2,12 +2,11 @@ add_flang_library(flangFrontendTool
   ExecuteCompilerInvocation.cpp
 
   DEPENDS
-  clangBasic
+  clang-cpp
 
   LINK_LIBS
   flangFrontend
-  clangBasic
-  clangDriver
+  clang-cpp
 
   LINK_COMPONENTS
   Option

diff  --git a/flang/tools/flang-driver/CMakeLists.txt 
b/flang/tools/flang-driver/CMakeLists.txt
index 4c7ad220d223a..76fba10538ce1 100644
--- a/flang/tools/flang-driver/CMakeLists.txt
+++ b/flang/tools/flang-driver/CMakeLists.txt
@@ -23,8 +23,7 @@ target_link_libraries(flang-new
 
 clang_target_link_libraries(flang-new
   PRIVATE
-  clangDriver
-  clangBasic
+  clang-cpp
 )
 
 install(TARGETS flang-new DESTINATION bin)

diff  --git a/flang/unittests/Frontend/CMakeLists.txt 
b/flang/unittests/Frontend/CMakeLists.txt
index b78adf3f50229..29a2007f6f8c5 100644
--- a/flang/unittests/Frontend/CMakeLists.txt
+++ b/flang/unittests/Frontend/CMakeLists.txt
@@ -5,7 +5,7 @@ add_flang_unittest(FlangFrontendTests
 
 target_link_libraries(FlangFrontendTests
   PRIVATE
-  clangBasic
+  clang-cpp
   flangFrontend
   flangFrontendTool
   FortranParser



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] 64f04f6 - [OpenMP] Fix performance regression reported in bug #51235

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Shilei Tian
Date: 2021-08-10T00:48:14-07:00
New Revision: 64f04f6b228ba5237f4ea9ca5beb2923d54c5e5c

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

LOG: [OpenMP] Fix performance regression reported in bug #51235

This patch fixes the "performance regression" reported in 
https://bugs.llvm.org/show_bug.cgi?id=51235. In fact it has nothing to do with 
performance. The root cause is, the stolen task is not allowed to execute by 
another thread because by default it is tied task. Since hidden helper task 
will always be executed by hidden helper threads, it should be untied.

Reviewed By: protze.joachim

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

(cherry picked from commit 9f5d6ea52eb120ba370bf16ee0537602c6fc727e)

Added: 


Modified: 
openmp/runtime/src/kmp_tasking.cpp

Removed: 




diff  --git a/openmp/runtime/src/kmp_tasking.cpp 
b/openmp/runtime/src/kmp_tasking.cpp
index 6c3e2c95cb5a2..55e9c307638a6 100644
--- a/openmp/runtime/src/kmp_tasking.cpp
+++ b/openmp/runtime/src/kmp_tasking.cpp
@@ -1441,6 +1441,7 @@ kmp_task_t *__kmpc_omp_target_task_alloc(ident_t 
*loc_ref, kmp_int32 gtid,
   if (__kmp_enable_hidden_helper) {
 auto &input_flags = reinterpret_cast(flags);
 input_flags.hidden_helper = TRUE;
+input_flags.tiedness = TASK_UNTIED;
   }
 
   return __kmpc_omp_task_alloc(loc_ref, gtid, flags, sizeof_kmp_task_t,



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] 19ee94d - [mlir] Avoid including on FreeBSD and NetBSD

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Dimitry Andric
Date: 2021-08-10T01:01:42-07:00
New Revision: 19ee94d36b93dd1f5e277640c192ceb9b8236b0a

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

LOG: [mlir] Avoid including  on FreeBSD and NetBSD

Instead, include `` which is the canonical header containing
the declaration of `alloca()`.

Reviewed By: bondhugula

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

(cherry picked from commit ab4b4684a26c31b1eb507a7eb6d2f4ac30764c3d)

Added: 


Modified: 
mlir/lib/ExecutionEngine/CRunnerUtils.cpp

Removed: 




diff  --git a/mlir/lib/ExecutionEngine/CRunnerUtils.cpp 
b/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
index 0207232871f87..5307d08eebae5 100644
--- a/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
+++ b/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
@@ -15,7 +15,11 @@
 #include "mlir/ExecutionEngine/CRunnerUtils.h"
 
 #ifndef _WIN32
+#if defined(__FreeBSD__) || defined(__NetBSD__)
+#include 
+#else
 #include 
+#endif
 #include 
 #else
 #include "malloc.h"



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] a1a5cfd - [libomptarget][amdgpu] use --allow-shlib-undefined to link on FreeBSD

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Dimitry Andric
Date: 2021-08-10T15:33:32-07:00
New Revision: a1a5cfdee04276b6ea72d26e177df5f86d650c80

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

LOG: [libomptarget][amdgpu] use --allow-shlib-undefined to link on FreeBSD

On FreeBSD, the `environ` symbol is undefined at link time for shared
libraries, but resolved by the dynamic linker at runtime. Therefore,
allow the symbol to be undefined when creating a shared library, by
using the `--allow-shlib-undefined` linker flag, instead of `-z defs`
(a.k.a `--no-undefined`).

Reviewed By: JonChesterfield

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

(cherry picked from commit 400cd6d2f0496e913e25285615a86f9c29811171)

Added: 


Modified: 
openmp/libomptarget/plugins/amdgpu/CMakeLists.txt

Removed: 




diff  --git a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt 
b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
index 2904bb386c00d..c464d1202735e 100644
--- a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
@@ -78,6 +78,15 @@ add_library(omptarget.rtl.amdgpu SHARED
 # When we build for debug, OPENMP_LIBDIR_SUFFIX get set to -debug
 install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION 
"lib${OPENMP_LIBDIR_SUFFIX}")
 
+if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+  # On FreeBSD, the 'environ' symbol is undefined at link time, but resolved by
+  # the dynamic linker at runtime. Therefore, allow the symbol to be undefined
+  # when creating a shared library.
+  set(LDFLAGS_UNDEFINED "-Wl,--allow-shlib-undefined")
+else()
+  set(LDFLAGS_UNDEFINED "-Wl,-z,defs")
+endif()
+
 set_property(TARGET omptarget.rtl.amdgpu PROPERTY INSTALL_RPATH "$ORIGIN")
 target_link_libraries(
   omptarget.rtl.amdgpu
@@ -88,7 +97,7 @@ target_link_libraries(
   ${LIBOMPTARGET_DEP_LIBELF_LIBRARIES}
   ${OPENMP_PTHREAD_LIB}
   "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/../exports"
-  "-Wl,-z,defs"
+  ${LDFLAGS_UNDEFINED}
   )
 
 if (LLVM_BINARY_DIR)



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] bb93426 - Revert "Link against libclang-cpp.so"

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Tom Stellard
Date: 2021-08-10T15:32:49-07:00
New Revision: bb934263aca9fa57c2cb3550e605a4471d149cee

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

LOG: Revert "Link against libclang-cpp.so"

This reverts commit ba485d5bd56fd00e2e12522e76788bc52a87a4a9.

This was committed on accident.

Added: 


Modified: 
flang/lib/Frontend/CMakeLists.txt
flang/lib/FrontendTool/CMakeLists.txt
flang/tools/flang-driver/CMakeLists.txt
flang/unittests/Frontend/CMakeLists.txt

Removed: 




diff  --git a/flang/lib/Frontend/CMakeLists.txt 
b/flang/lib/Frontend/CMakeLists.txt
index 0f40f1d97f937..abaa77f6af54d 100644
--- a/flang/lib/Frontend/CMakeLists.txt
+++ b/flang/lib/Frontend/CMakeLists.txt
@@ -9,7 +9,7 @@ add_flang_library(flangFrontend
   TextDiagnostic.cpp
 
   DEPENDS
-  clang-cpp
+  clangBasic
 
   LINK_LIBS
   FortranParser
@@ -17,7 +17,8 @@ add_flang_library(flangFrontend
   FortranEvaluate
   FortranCommon
   FortranLower
-  clang-cpp
+  clangBasic
+  clangDriver
 
   LINK_COMPONENTS
   Option

diff  --git a/flang/lib/FrontendTool/CMakeLists.txt 
b/flang/lib/FrontendTool/CMakeLists.txt
index e9e1bba122c6f..65e1dd5188ac6 100644
--- a/flang/lib/FrontendTool/CMakeLists.txt
+++ b/flang/lib/FrontendTool/CMakeLists.txt
@@ -2,11 +2,12 @@ add_flang_library(flangFrontendTool
   ExecuteCompilerInvocation.cpp
 
   DEPENDS
-  clang-cpp
+  clangBasic
 
   LINK_LIBS
   flangFrontend
-  clang-cpp
+  clangBasic
+  clangDriver
 
   LINK_COMPONENTS
   Option

diff  --git a/flang/tools/flang-driver/CMakeLists.txt 
b/flang/tools/flang-driver/CMakeLists.txt
index 76fba10538ce1..4c7ad220d223a 100644
--- a/flang/tools/flang-driver/CMakeLists.txt
+++ b/flang/tools/flang-driver/CMakeLists.txt
@@ -23,7 +23,8 @@ target_link_libraries(flang-new
 
 clang_target_link_libraries(flang-new
   PRIVATE
-  clang-cpp
+  clangDriver
+  clangBasic
 )
 
 install(TARGETS flang-new DESTINATION bin)

diff  --git a/flang/unittests/Frontend/CMakeLists.txt 
b/flang/unittests/Frontend/CMakeLists.txt
index 29a2007f6f8c5..b78adf3f50229 100644
--- a/flang/unittests/Frontend/CMakeLists.txt
+++ b/flang/unittests/Frontend/CMakeLists.txt
@@ -5,7 +5,7 @@ add_flang_unittest(FlangFrontendTests
 
 target_link_libraries(FlangFrontendTests
   PRIVATE
-  clang-cpp
+  clangBasic
   flangFrontend
   flangFrontendTool
   FortranParser



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 341d7cf - [AArch64][SVE] Fix assertion failure when lowering fixed length gather/scatter

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Bradley Smith
Date: 2021-08-10T15:34:36-07:00
New Revision: 341d7cf911f8ba6cef2c3a679fe491740d2b4199

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

LOG: [AArch64][SVE] Fix assertion failure when lowering fixed length 
gather/scatter

The patterns for fixed length gather/scatter with 32-bit offsets and
64-bit memory type are slightly different that the rest of the patterns,
as such the lowering needs to be slightly different to ensure the
correct types are used.

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

(cherry picked from commit 73ecb9987b00db274b7b2ac34b0602ffdb906a4b)

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/sve-fixed-length-masked-gather.ll
llvm/test/CodeGen/AArch64/sve-fixed-length-masked-scatter.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp 
b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index ca6b87a5ebb04..b27a02b8c1828 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -4353,8 +4353,13 @@ SDValue AArch64TargetLowering::LowerMGATHER(SDValue Op,
   if (IsFixedLength) {
 assert(Subtarget->useSVEForFixedLengthVectors() &&
"Cannot lower when not using SVE for fixed vectors");
-IndexVT = getContainerForFixedLengthVector(DAG, IndexVT);
-MemVT = IndexVT.changeVectorElementType(MemVT.getVectorElementType());
+if (MemVT.getScalarSizeInBits() <= IndexVT.getScalarSizeInBits()) {
+  IndexVT = getContainerForFixedLengthVector(DAG, IndexVT);
+  MemVT = IndexVT.changeVectorElementType(MemVT.getVectorElementType());
+} else {
+  MemVT = getContainerForFixedLengthVector(DAG, MemVT);
+  IndexVT = MemVT.changeTypeToInteger();
+}
 InputVT = DAG.getValueType(MemVT.changeTypeToInteger());
 Mask = DAG.getNode(
 ISD::ZERO_EXTEND, DL,
@@ -4453,8 +4458,13 @@ SDValue AArch64TargetLowering::LowerMSCATTER(SDValue Op,
   if (IsFixedLength) {
 assert(Subtarget->useSVEForFixedLengthVectors() &&
"Cannot lower when not using SVE for fixed vectors");
-IndexVT = getContainerForFixedLengthVector(DAG, IndexVT);
-MemVT = IndexVT.changeVectorElementType(MemVT.getVectorElementType());
+if (MemVT.getScalarSizeInBits() <= IndexVT.getScalarSizeInBits()) {
+  IndexVT = getContainerForFixedLengthVector(DAG, IndexVT);
+  MemVT = IndexVT.changeVectorElementType(MemVT.getVectorElementType());
+} else {
+  MemVT = getContainerForFixedLengthVector(DAG, MemVT);
+  IndexVT = MemVT.changeTypeToInteger();
+}
 InputVT = DAG.getValueType(MemVT.changeTypeToInteger());
 
 StoreVal =

diff  --git a/llvm/test/CodeGen/AArch64/sve-fixed-length-masked-gather.ll 
b/llvm/test/CodeGen/AArch64/sve-fixed-length-masked-gather.ll
index 20b8d10ebe30a..ee64e6db65689 100644
--- a/llvm/test/CodeGen/AArch64/sve-fixed-length-masked-gather.ll
+++ b/llvm/test/CodeGen/AArch64/sve-fixed-length-masked-gather.ll
@@ -917,8 +917,8 @@ define void @masked_gather_v32f64(<32 x double>* %a, <32 x 
double*>* %b) #0 {
 ; The above tests test the types, the below tests check that the addressing
 ; modes still function
 
-define void @masked_gather_32b_scaled_sext(<32 x half>* %a, <32 x i32>* %b, 
half* %base) #0 {
-; CHECK-LABEL: masked_gather_32b_scaled_sext:
+define void @masked_gather_32b_scaled_sext_f16(<32 x half>* %a, <32 x i32>* 
%b, half* %base) #0 {
+; CHECK-LABEL: masked_gather_32b_scaled_sext_f16:
 ; VBITS_GE_2048: ptrue [[PG0:p[0-9]+]].h, vl32
 ; VBITS_GE_2048-NEXT: ld1h { [[VALS:z[0-9]+]].h }, [[PG0]]/z, [x0]
 ; VBITS_GE_2048-NEXT: ptrue [[PG1:p[0-9]+]].s, vl32
@@ -941,6 +941,45 @@ define void @masked_gather_32b_scaled_sext(<32 x half>* 
%a, <32 x i32>* %b, half
   ret void
 }
 
+define void @masked_gather_32b_scaled_sext_f32(<32 x float>* %a, <32 x i32>* 
%b, float* %base) #0 {
+; CHECK-LABEL: masked_gather_32b_scaled_sext_f32:
+; VBITS_GE_2048: ptrue [[PG:p[0-9]+]].s, vl32
+; VBITS_GE_2048-NEXT: ld1w { [[VALS:z[0-9]+]].s }, [[PG]]/z, [x0]
+; VBITS_GE_2048-NEXT: ld1w { [[PTRS:z[0-9]+]].s }, [[PG]]/z, [x1]
+; VBITS_GE_2048-NEXT: fcmeq [[MASK:p[0-9]+]].s, [[PG]]/z, [[VALS]].s, #0.0
+; VBITS_GE_2048-NEXT: ld1w { [[RES:z[0-9]+]].s }, [[MASK]]/z, [x2, [[PTRS]].s, 
sxtw #2]
+; VBITS_GE_2048-NEXT: st1w { [[RES]].s }, [[PG]], [x0]
+; VBITS_GE_2048-NEXT: ret
+  %cvals = load <32 x float>, <32 x float>* %a
+  %idxs = load <32 x i32>, <32 x i32>* %b
+  %ext = sext <32 x i32> %idxs to <32 x i64>
+  %ptrs = getelementptr float, float* %base, <32 x i64> %ext
+  %mask = fcmp oeq <32 x float> %cvals, zeroinitializer
+  %vals = call <32 x float> @llvm.masked.gather.v32f32(<32 x float*> %ptrs, 
i32 8, <32 x i1> %mask, <32 x float> undef)
+  store <32

[llvm-branch-commits] [lldb] bf742f2 - [lldb] [test] Skip Expr/nodefaultlib.cpp test if LD_PRELOAD Is used

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Michał Górny
Date: 2021-08-10T15:35:25-07:00
New Revision: bf742f285094e0468ea2cd7aa079f13b1ce8d0fd

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

LOG: [lldb] [test] Skip Expr/nodefaultlib.cpp test if LD_PRELOAD Is used

Some LD_PRELOAD-ed libraries tend to interact badly with --nodefaultlib,
particularly Gentoo sandbox.  Do not run this test if LD_PRELOAD is
present in the running environment.

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

(cherry picked from commit 15cacab73f7e36d9dca4a5516ccb360b67bf2dbc)

Added: 


Modified: 
lldb/test/Shell/Expr/nodefaultlib.cpp
lldb/test/Shell/lit.cfg.py

Removed: 




diff  --git a/lldb/test/Shell/Expr/nodefaultlib.cpp 
b/lldb/test/Shell/Expr/nodefaultlib.cpp
index 5c4f19d40efc7..fb53da7fcb08b 100644
--- a/lldb/test/Shell/Expr/nodefaultlib.cpp
+++ b/lldb/test/Shell/Expr/nodefaultlib.cpp
@@ -2,6 +2,7 @@
 // standard library (and mmap-like functions in particular).
 
 // REQUIRES: native
+// UNSUPPORTED: ld_preload-present
 // XFAIL: system-linux && !(target-x86 || target-x86_64)
 // XFAIL: system-netbsd || system-freebsd || system-darwin
 

diff  --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py
index 964efc8c3505f..aecd9d62c2144 100644
--- a/lldb/test/Shell/lit.cfg.py
+++ b/lldb/test/Shell/lit.cfg.py
@@ -140,3 +140,6 @@ def calculate_arch_features(arch_string):
 can_set_dbregs = False
 if can_set_dbregs:
 config.available_features.add('dbregs-set')
+
+if 'LD_PRELOAD' in os.environ:
+config.available_features.add('ld_preload-present')



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] 8c1ca94 - [lldb] [cmake] Add LLVM_LIT_ARGS override support for standalone builds

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Michał Górny
Date: 2021-08-10T15:36:07-07:00
New Revision: 8c1ca94ad27e3ab088a0cdf35b2420579b9407e2

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

LOG: [lldb] [cmake] Add LLVM_LIT_ARGS override support for standalone builds

Add a LLVM_LIT_ARGS cached variable in order to make it possible
to override lit arguments when doing standalone builds.  Without that,
the user variable is ignored and the default options are always used.

Based on a similar solution found in clang.

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

(cherry picked from commit 614c7d03877fd99c2de47429b15be3f00306a3bd)

Added: 


Modified: 
lldb/cmake/modules/LLDBStandalone.cmake

Removed: 




diff  --git a/lldb/cmake/modules/LLDBStandalone.cmake 
b/lldb/cmake/modules/LLDBStandalone.cmake
index 94781c3583744..98d7848ce99b0 100644
--- a/lldb/cmake/modules/LLDBStandalone.cmake
+++ b/lldb/cmake/modules/LLDBStandalone.cmake
@@ -10,6 +10,8 @@ set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR} CACHE PATH 
"Path to LLVM source
 set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_INCLUDE_DIR} CACHE PATH "Path to 
llvm/include")
 set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR} CACHE PATH "Path to LLVM build tree")
 
+set(LLVM_LIT_ARGS "-sv" CACHE STRING "Default options for lit")
+
 set(lit_file_name "llvm-lit")
 if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
   set(lit_file_name "${lit_file_name}.py")



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 4dd6815 - [llvm] [cmake] Export LLVM_ENABLE_NEW_PASS_MANAGER into LLVMConfig.cmake

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Michał Górny
Date: 2021-08-10T15:37:05-07:00
New Revision: 4dd68156855240cd63dd59959fb02f320dd76691

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

LOG: [llvm] [cmake] Export LLVM_ENABLE_NEW_PASS_MANAGER into LLVMConfig.cmake

Include the vaue of LLVM_ENABLE_NEW_PASS_MANAGER in generated
LLVMConfig.cmake since it is needed by clang's build system.  This fixes
test failures when the new pass manager is enabled (i.e. by default)
by having clang's CMake files correctly detect that and skip relevant
tests.

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

(cherry picked from commit 889a1e69bd2d65c368712ec653450099446aed33)

Added: 


Modified: 
llvm/cmake/modules/LLVMConfig.cmake.in

Removed: 




diff  --git a/llvm/cmake/modules/LLVMConfig.cmake.in 
b/llvm/cmake/modules/LLVMConfig.cmake.in
index 90a98406c0ed6..60b56b5152ea8 100644
--- a/llvm/cmake/modules/LLVMConfig.cmake.in
+++ b/llvm/cmake/modules/LLVMConfig.cmake.in
@@ -76,6 +76,8 @@ set(LLVM_ENABLE_PIC @LLVM_ENABLE_PIC@)
 
 set(LLVM_BUILD_32_BITS @LLVM_BUILD_32_BITS@)
 
+set(LLVM_ENABLE_NEW_PASS_MANAGER @LLVM_ENABLE_NEW_PASS_MANAGER@)
+
 if (NOT "@LLVM_PTHREAD_LIB@" STREQUAL "")
   set(LLVM_PTHREAD_LIB "@LLVM_PTHREAD_LIB@")
 endif()



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 6797077 - libcang: Add missing function to libclang.map

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Tom Stellard
Date: 2021-08-10T19:02:49-07:00
New Revision: 67970771d91c3f77fe3e2e1f8989afd7e9cdab3c

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

LOG: libcang: Add missing function to libclang.map

This function is marked with CINDEX_LINKAGE, but was never added to the
export list / linker script.

Reviewed By: jrtc27

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

(cherry picked from commit a4edb2b1ba0bda9042e87ca3f3e1b9f70598df9a)

Added: 


Modified: 
clang/tools/libclang/libclang.map

Removed: 




diff  --git a/clang/tools/libclang/libclang.map 
b/clang/tools/libclang/libclang.map
index 932903bb4140..aee46b144845 100644
--- a/clang/tools/libclang/libclang.map
+++ b/clang/tools/libclang/libclang.map
@@ -49,6 +49,7 @@ LLVM_13 {
 clang_CompileCommand_getMappedSourceContent;
 clang_CompileCommand_getMappedSourcePath;
 clang_CompileCommand_getNumArgs;
+clang_CompileCommand_getNumMappedSources;
 clang_CompileCommands_dispose;
 clang_CompileCommands_getCommand;
 clang_CompileCommands_getSize;



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] b33de54 - [clang] Fix libclang linking on Solaris

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Rainer Orth
Date: 2021-08-10T19:03:12-07:00
New Revision: b33de5411594508c2ef357d5db10b8705e9b302a

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

LOG: [clang] Fix libclang linking on Solaris

Linking `libclang.so` is currently broken on Solaris:

  ld: fatal: option --version-script requires option -z 
gnu-version-script-compat to be specified

While Solaris `ld` supports a considerable subset of `--version-script`,
there are some elements of the syntax that aren't.

The fix is equivalent to D78510 .

Additionally, use of C-style comments is a GNU extension
that can easily be avoided by using `#` as comment character, which is
supported by GNU `ld`, `gold`, and `lld`.

Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`,
`x86_64-pc-linux-gnu`.

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

(cherry picked from commit a382a746275b4a1eb1867331efa2319c614305d8)

Added: 


Modified: 
clang/tools/libclang/CMakeLists.txt
clang/tools/libclang/libclang.map

Removed: 




diff  --git a/clang/tools/libclang/CMakeLists.txt 
b/clang/tools/libclang/CMakeLists.txt
index 8cc0fc622174..7148bdccfba4 100644
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -162,6 +162,11 @@ if(ENABLE_SHARED)
   endif()
   if (USE_VERSION_SCRIPT)
 target_link_options(libclang PRIVATE 
"-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/libclang.map")
+# The Solaris 11.4 linker supports a subset of GNU ld version scripts,
+# but requires a special option to enable it.
+if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+  target_link_options(libclang PRIVATE "-Wl,-z,gnu-version-script-compat")
+endif()
 # Ensure that libclang.so gets rebuilt when the linker script changes.
 set_property(SOURCE ARCMigrate.cpp APPEND PROPERTY
  OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libclang.map)

diff  --git a/clang/tools/libclang/libclang.map 
b/clang/tools/libclang/libclang.map
index aee46b144845..716e2474966d 100644
--- a/clang/tools/libclang/libclang.map
+++ b/clang/tools/libclang/libclang.map
@@ -1,10 +1,8 @@
-/* If you add a symbol to this file, make sure to add it with the correct
- * version.  For example, if the LLVM main branch is LLVM 14.0.0, add new
- * symbols with the version LLVM_14.
- * On platforms where versions scripts are not used, this file will be used to
- * generate a list of exports for libclang.so
- */
-
+# If you add a symbol to this file, make sure to add it with the correct
+# version.  For example, if the LLVM main branch is LLVM 14.0.0, add new
+# symbols with the version LLVM_14.
+# On platforms where versions scripts are not used, this file will be used to
+# generate a list of exports for libclang.so
 
 LLVM_13 {
   global:
@@ -407,10 +405,9 @@ LLVM_13 {
   local: *;
 };
 
-/* Example of how to add a new symbol version entry.  If you do add a new 
symbol
- * version, please update the example to depend on the version you added.
- * LLVM_X {
- * global:
- *clang_newsymbol;
- * };
- */
+# Example of how to add a new symbol version entry.  If you do add a new symbol
+# version, please update the example to depend on the version you added.
+# LLVM_X {
+# global:
+#   clang_newsymbol;
+# };



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 0c7a28d - Drop LLVM_VERSION_SUFFIX

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Tom Stellard
Date: 2021-08-10T20:50:20-07:00
New Revision: 0c7a28d696dd387275becb51d8a5aa6b28df77ab

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

LOG: Drop LLVM_VERSION_SUFFIX

Added: 


Modified: 
llvm/CMakeLists.txt

Removed: 




diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 68cd2def61ed7..99773a5ee546c 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -20,7 +20,7 @@ if(NOT DEFINED LLVM_VERSION_PATCH)
   set(LLVM_VERSION_PATCH 0)
 endif()
 if(NOT DEFINED LLVM_VERSION_SUFFIX)
-  set(LLVM_VERSION_SUFFIX git)
+  set(LLVM_VERSION_SUFFIX)
 endif()
 
 if (NOT PACKAGE_VERSION)



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 4178fa1 - [RISCV] Add scheduling resources for V

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Evandro Menezes
Date: 2021-08-10T23:11:38-07:00
New Revision: 4178fa17a286e4f19018c00174cd82638b91ce0f

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

LOG: [RISCV] Add scheduling resources for V

Add the scheduling resources for the V extension instructions.

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

(cherry picked from commit 63a5ac4e0d969f41bf71785cc3979349a45a2892)

Added: 
llvm/lib/Target/RISCV/RISCVScheduleV.td

Modified: 
llvm/lib/Target/RISCV/RISCVInstrInfoV.td
llvm/lib/Target/RISCV/RISCVSchedRocket.td
llvm/lib/Target/RISCV/RISCVSchedSiFive7.td
llvm/lib/Target/RISCV/RISCVSchedule.td

Removed: 




diff  --git a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td 
b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td
index 342497150d495..8af3c8f5cfdb2 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td
@@ -77,6 +77,39 @@ def simm5_plus1 : Operand, ImmLeaf: Sched <[!cast("WriteVMov" # n # "V"),
+!cast("ReadVMov" # n # "V")]>;
+
+class VLESched : Sched <[!cast("WriteVLDE" # n),
+ReadVLDX, ReadVMask]>;
+
+class VSESched : Sched <[!cast("WriteVSTE" # n),
+!cast("ReadVSTE" # n # "V"),
+ReadVSTX, ReadVMask]>;
+
+class VLSSched : Sched <[!cast("WriteVLDS" # n),
+ReadVLDX, ReadVLDSX, ReadVMask]>;
+
+class VSSSched : Sched <[!cast("WriteVSTS" # n),
+!cast("ReadVSTS" # n # "V"),
+ReadVSTX, ReadVSTSX, ReadVMask]>;
+
+class VLXSched :
+  Sched <[!cast("WriteVLD" # o # "X" # n),
+  ReadVLDX, !cast("ReadVLD" # o # "XV"), ReadVMask]>;
+
+class VSXSched :
+  Sched <[!cast("WriteVST" # o # "X" # n),
+  !cast("ReadVST" # o # "X" # n),
+  ReadVSTX, !cast("ReadVST" # o # "XV"), ReadVMask]>;
+
+class VLFSched : Sched <[!cast("WriteVLDFF" # n),
+ReadVLDX, ReadVMask]>;
+
 
//===--===//
 // Instruction class templates
 
//===--===//
@@ -328,106 +361,417 @@ class VAMONoWd
 // Use these multiclasses to define instructions more easily.
 
//===--===//
 multiclass VALU_IV_V_X_I funct6, Operand optype = 
simm5, string vw = "v"> {
-  def V  : VALUVV;
-  def X  : VALUVX;
-  def I  : VALUVI;
+  def V  : VALUVV,
+   Sched<[WriteVIALUV, ReadVIALUV, ReadVIALUV, ReadVMask]>;
+  def X  : VALUVX,
+   Sched<[WriteVIALUX, ReadVIALUV, ReadVIALUX, ReadVMask]>;
+  def I  : VALUVI,
+   Sched<[WriteVIALUI, ReadVIALUV, ReadVMask]>;
 }
 
 multiclass VALU_IV_V_X funct6, string vw = "v"> {
-  def V  : VALUVV;
-  def X  : VALUVX;
+  def V  : VALUVV,
+   Sched<[WriteVIALUV, ReadVIALUV, ReadVIALUV, ReadVMask]>;
+  def X  : VALUVX,
+   Sched<[WriteVIALUX, ReadVIALUV, ReadVIALUX, ReadVMask]>;
 }
 
-multiclass VALUr_IV_V_X funct6, string vw = "v"> {
-  def V : VALUrVV;
-  def X : VALUrVX;
+multiclass VALU_IV_X_I funct6, Operand optype = 
simm5, string vw = "v"> {
+  def X  : VALUVX,
+   Sched<[WriteVIALUV, ReadVIALUV, ReadVIALUX, ReadVMask]>;
+  def I  : VALUVI,
+   Sched<[WriteVIALUI, ReadVIALUV, ReadVMask]>;
 }
 
-multiclass VALU_IV_X_I funct6, Operand optype = 
simm5, string vw = "v"> {
-  def X  : VALUVX;
-  def I  : VALUVI;
+multiclass VALU_MV_V_X funct6, string vw = "v"> {
+  def V  : VALUVV,
+   Sched<[WriteVIWALUV, ReadVIWALUV, ReadVIWALUV, ReadVMask]>;
+  def X  : VALUVX,
+   Sched<[WriteVIWALUX, ReadVIWALUV, ReadVIWALUX, ReadVMask]>;
 }
 
-multiclass VALU_IV_V funct6> {
-  def _VS  : VALUVV;
+multiclass VMAC_MV_V_X funct6, string vw = "v"> {
+  def V : VALUrVV,
+  Sched<[WriteVIMulAddV, ReadVIMulAddV, ReadVIMulAddV, ReadVMask]>;
+  def X : VALUrVX,
+  Sched<[WriteVIMulAddX, ReadVIMulAddV, ReadVIMulAddX, ReadVMask]>;
 }
 
-multiclass VALUr_IV_X funct6, string vw = "v"> {
-  def X : VALUrVX;
+multiclass VWMAC_MV_V_X funct6, string vw = "v"> {
+  def V : VALUrVV,
+  Sched<[WriteVIWMulAddV, ReadVIWMulAddV, ReadVIWMulAddV, ReadVMask]>;
+  def X : VALUrVX,
+  Sched<[WriteVIWMulAddX, ReadVIWMulAddV, ReadVIWMulAddX, ReadVMask]>;
 }
 
-multiclass VALU_MV_V_X funct6, string vw = "v"> {
-  def V : VALUVV;
-  def X  : VALUVX;
+multiclass VWMAC_MV_X funct6, string vw = "v"> {
+  def X : VALUrVX,
+  Sched<[WriteVIWMulAddX, ReadVIWMulAddV, ReadVIWMulAddX, ReadVMask]>;
+}
+
+multiclass VALU_MV_VS2 funct6, bits<5> vs1> {
+  def "" : VALUVs2,
+   Sched<[WriteVExtV, ReadVExtV, Read

[llvm-branch-commits] [clang] 168ece2 - [clang] fix canonicalization of nested name specifiers

2021-08-10 Thread Tom Stellard via llvm-branch-commits

Author: Matheus Izvekov
Date: 2021-08-10T23:12:57-07:00
New Revision: 168ece289bd4266b711f9bbccc0fe52eb772700c

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

LOG: [clang] fix canonicalization of nested name specifiers

See PR47174.

When canonicalizing nested name specifiers of the type kind,
the prefix for 'DependentTemplateSpecialization' types was being
dropped, leading to malformed types which would cause failures
when rebuilding template names.

Signed-off-by: Matheus Izvekov 

Reviewed By: rsmith

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

(cherry picked from commit 219790c1f53665a8b5f7578472e5c2675f9bec6a)

Added: 


Modified: 
clang/include/clang/Sema/Sema.h
clang/lib/AST/ASTContext.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/test/CXX/temp/temp.constr/temp.constr.normal/p1.cpp

Removed: 




diff  --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 83a2d132bf6a4..d8b2546b81a34 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -7828,8 +7828,7 @@ class Sema final {
  TemplateArgumentLoc &Arg,
SmallVectorImpl &Converted);
 
-  bool CheckTemplateArgument(TemplateTypeParmDecl *Param,
- TypeSourceInfo *Arg);
+  bool CheckTemplateArgument(TypeSourceInfo *Arg);
   ExprResult CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
QualType InstantiatedParamType, Expr *Arg,
TemplateArgument &Converted,

diff  --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index e102a3ba508d4..fdba204fbe7ff 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -6066,9 +6066,11 @@ 
ASTContext::getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const {
 NNS->getAsNamespaceAlias()->getNamespace()
   
->getOriginalNamespace());
 
+  // The 
diff erence between TypeSpec and TypeSpecWithTemplate is that the
+  // latter will have the 'template' keyword when printed.
   case NestedNameSpecifier::TypeSpec:
   case NestedNameSpecifier::TypeSpecWithTemplate: {
-QualType T = getCanonicalType(QualType(NNS->getAsType(), 0));
+const Type *T = getCanonicalType(NNS->getAsType());
 
 // If we have some kind of dependent-named type (e.g., "typename T::type"),
 // break it apart into its prefix and identifier, then reconsititute those
@@ -6078,14 +6080,16 @@ 
ASTContext::getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const {
 //   typedef typename T::type T1;
 //   typedef typename T1::type T2;
 if (const auto *DNT = T->getAs())
-  return NestedNameSpecifier::Create(*this, DNT->getQualifier(),
-   const_cast(DNT->getIdentifier()));
-
-// Otherwise, just canonicalize the type, and force it to be a TypeSpec.
-// FIXME: Why are TypeSpec and TypeSpecWithTemplate distinct in the
-// first place?
+  return NestedNameSpecifier::Create(
+  *this, DNT->getQualifier(),
+  const_cast(DNT->getIdentifier()));
+if (const auto *DTST = T->getAs())
+  return NestedNameSpecifier::Create(*this, DTST->getQualifier(), true,
+ const_cast(T));
+
+// TODO: Set 'Template' parameter to true for other template types.
 return NestedNameSpecifier::Create(*this, nullptr, false,
-   const_cast(T.getTypePtr()));
+   const_cast(T));
   }
 
   case NestedNameSpecifier::Global:

diff  --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 83c97626ff7e7..da4f4f8620955 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -12472,6 +12472,8 @@ bool Sema::CheckUsingDeclRedeclaration(SourceLocation 
UsingLoc,
 return false;
   }
 
+  const NestedNameSpecifier *CNNS =
+  Context.getCanonicalNestedNameSpecifier(Qual);
   for (LookupResult::iterator I = Prev.begin(), E = Prev.end(); I != E; ++I) {
 NamedDecl *D = *I;
 
@@ -12497,8 +12499,7 @@ bool Sema::CheckUsingDeclRedeclaration(SourceLocation 
UsingLoc,
 // using decls 
diff er if they name 
diff erent scopes (but note that
 // template instantiation can cause this check to trigger when it
 // didn't before instantiation).
-if (Context.getCanonicalNestedNameSpecifier(Qual) !=
-Context.getCanonicalNestedNameSpecifier(DQual))
+if (CNNS != Context.getCanonicalNestedNameSpecifier(DQual))
   continue;
 
 Diag(NameLoc, diag::err_using_decl_redeclaration) << SS.getRange();