[Lldb-commits] [lldb] be5f35e - lldb: Fix usage of sve functions on arm64

2023-04-27 Thread Manoj Gupta via lldb-commits

Author: Manoj Gupta
Date: 2023-04-27T14:59:49-07:00
New Revision: be5f35e24f4c15caf3c4aeccddc54c52560c28a0

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

LOG: lldb: Fix usage of sve functions on arm64

Use correct internal sve functions for arm64.
Otherwise, when cross-compling lld for AArch64 there are build
errors like:
NativeRegisterContextLinux_arm64.cpp:936:11:
   error: use of undeclared identifier 'sve_vl_valid
NativeRegisterContextLinux_arm64.cpp:63:28:
error: variable has incomplete type 'struct user_sve_header'

Reviewed By: omjavaid

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

Added: 


Modified: 
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp 
b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
index c57b9499d5247..0ec152f0643a4 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -61,7 +61,7 @@ 
NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
   case llvm::Triple::aarch64: {
 // Configure register sets supported by this AArch64 target.
 // Read SVE header to check for SVE support.
-struct user_sve_header sve_header;
+struct sve::user_sve_header sve_header;
 struct iovec ioVec;
 ioVec.iov_base = &sve_header;
 ioVec.iov_len = sizeof(sve_header);
@@ -380,7 +380,7 @@ Status NativeRegisterContextLinux_arm64::WriteRegister(
   if (GetRegisterInfo().IsSVERegVG(reg)) {
 uint64_t vg_value = reg_value.GetAsUInt64();
 
-if (sve_vl_valid(vg_value * 8)) {
+if (sve::vl_valid(vg_value * 8)) {
   if (m_sve_header_is_valid && vg_value == GetSVERegVG())
 return error;
 
@@ -566,7 +566,7 @@ Status 
NativeRegisterContextLinux_arm64::WriteAllRegisterValues(
   if (contains_sve_reg_data) {
 // We have SVE register data first write SVE header.
 ::memcpy(GetSVEHeader(), src, GetSVEHeaderSize());
-if (!sve_vl_valid(m_sve_header.vl)) {
+if (!sve::vl_valid(m_sve_header.vl)) {
   m_sve_header_is_valid = false;
   error.SetErrorStringWithFormat("NativeRegisterContextLinux_arm64::%s "
  "Invalid SVE header in data_sp",
@@ -934,7 +934,7 @@ void 
NativeRegisterContextLinux_arm64::ConfigureRegisterContext() {
   // On every stop we configure SVE vector length by calling
   // ConfigureVectorLength regardless of current SVEState of this thread.
   uint32_t vq = RegisterInfoPOSIX_arm64::eVectorQuadwordAArch64SVE;
-  if (sve_vl_valid(m_sve_header.vl))
+  if (sve::vl_valid(m_sve_header.vl))
 vq = sve::vq_from_vl(m_sve_header.vl);
 
   GetRegisterInfo().ConfigureVectorLength(vq);



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


[Lldb-commits] [lldb] 1f7b25e - [lldb] skip host build for lldb_tblgen with LLDB_TABLEGEN_EXE set

2021-08-13 Thread Manoj Gupta via lldb-commits

Author: Manoj Gupta
Date: 2021-08-13T14:18:03-07:00
New Revision: 1f7b25ea76a925aca690da28de9d78db7ca99d0c

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

LOG: [lldb] skip host build for lldb_tblgen with LLDB_TABLEGEN_EXE set

When cross compiling lldb-server, do not create a host build
for building lldb-tblgeb when LLDB_TABLEGEN_EXE is already
provided. This avoids an expensive and time-consuming build step
if lldb-tblgen was already built previously for host.

Reviewed By: JDevlieghere

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

Added: 


Modified: 
lldb/CMakeLists.txt

Removed: 




diff  --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 2bb05c1e220b3..594c769141b43 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -64,7 +64,7 @@ if(LLVM_ENABLE_MODULES)
   list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen)
 endif()
 
-if(CMAKE_CROSSCOMPILING AND LLDB_BUILT_STANDALONE)
+if(CMAKE_CROSSCOMPILING AND LLDB_BUILT_STANDALONE AND NOT LLDB_TABLEGEN_EXE)
   set(LLVM_USE_HOST_TOOLS ON)
   include(CrossCompile)
   if (NOT NATIVE_LLVM_DIR OR NOT NATIVE_Clang_DIR)



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