[Lldb-commits] [lldb] 78b00c1 - Revert "[lldb] Improve maintainability and readability for ValueObject methods (#75865)"

2024-01-23 Thread Pavel Labath via lldb-commits

Author: Pavel Labath
Date: 2024-01-24T07:12:52Z
New Revision: 78b00c116be8b3b53ff13552e31eb305b11cb169

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

LOG: Revert "[lldb] Improve maintainability and readability for ValueObject 
methods (#75865)"

This reverts commit d657519838e4b2310e13ec5ff52599e041860825 as it
breaks two dozen tests. The breakages are related to variable path
expression parsing and summary string parsing (possibly the same code).

Added: 


Modified: 
lldb/source/Core/ValueObject.cpp

Removed: 




diff  --git a/lldb/source/Core/ValueObject.cpp 
b/lldb/source/Core/ValueObject.cpp
index d58bf2ca763d9e2..9208047be36668d 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1582,64 +1582,62 @@ bool ValueObject::IsUninitializedReference() {
 
 ValueObjectSP ValueObject::GetSyntheticArrayMember(size_t index,
bool can_create) {
-  if (!IsPointerType() && !IsArrayType())
-return ValueObjectSP();
-
-  std::string index_str = llvm::formatv("[{0}]", index);
-  ConstString index_const_str(index_str);
-  // Check if we have already created a synthetic array member in this valid
-  // object. If we have we will re-use it.
-  if (auto existing_synthetic_child = GetSyntheticChild(index_const_str))
-return existing_synthetic_child;
-
-  // We haven't made a synthetic array member for INDEX yet, so lets make
-  // one and cache it for any future reference.
-  ValueObject *synthetic_child = CreateChildAtIndex(0, true, index);
-
-  if (!synthetic_child)
-return ValueObjectSP();
-
-  // Cache the synthetic child's value because it's valid.
-  AddSyntheticChild(index_const_str, synthetic_child);
-  auto synthetic_child_sp = synthetic_child->GetSP();
-  synthetic_child_sp->SetName(ConstString(index_str));
-  synthetic_child_sp->m_flags.m_is_array_item_for_pointer = true;
+  ValueObjectSP synthetic_child_sp;
+  if (IsPointerType() || IsArrayType()) {
+std::string index_str = llvm::formatv("[{0}]", index);
+ConstString index_const_str(index_str);
+// Check if we have already created a synthetic array member in this valid
+// object. If we have we will re-use it.
+synthetic_child_sp = GetSyntheticChild(index_const_str);
+if (!synthetic_child_sp) {
+  ValueObject *synthetic_child;
+  // We haven't made a synthetic array member for INDEX yet, so lets make
+  // one and cache it for any future reference.
+  synthetic_child = CreateChildAtIndex(0, true, index);
+
+  // Cache the value if we got one back...
+  if (synthetic_child) {
+AddSyntheticChild(index_const_str, synthetic_child);
+synthetic_child_sp = synthetic_child->GetSP();
+synthetic_child_sp->SetName(ConstString(index_str));
+synthetic_child_sp->m_flags.m_is_array_item_for_pointer = true;
+  }
+}
+  }
   return synthetic_child_sp;
 }
 
 ValueObjectSP ValueObject::GetSyntheticBitFieldChild(uint32_t from, uint32_t 
to,
  bool can_create) {
-  if (!IsScalarType())
-return ValueObjectSP();
-
-  std::string index_str = llvm::formatv("[{0}-{1}]", from, to);
-  ConstString index_const_str(index_str);
-
-  // Check if we have already created a synthetic array member in this valid
-  // object. If we have we will re-use it.
-  if (auto existing_synthetic_child = GetSyntheticChild(index_const_str))
-return existing_synthetic_child;
-
-  uint32_t bit_field_size = to - from + 1;
-  uint32_t bit_field_offset = from;
-  if (GetDataExtractor().GetByteOrder() == eByteOrderBig)
-bit_field_offset =
-GetByteSize().value_or(0) * 8 - bit_field_size - bit_field_offset;
-
-  // We haven't made a synthetic array member for INDEX yet, so lets make
-  // one and cache it for any future reference.
-  ValueObjectChild *synthetic_child = new ValueObjectChild(
-  *this, GetCompilerType(), index_const_str, GetByteSize().value_or(0), 0,
-  bit_field_size, bit_field_offset, false, false, eAddressTypeInvalid, 0);
-
-  if (!synthetic_child)
-return ValueObjectSP();
-
-  // Cache the synthetic child's value because it's valid.
-  AddSyntheticChild(index_const_str, synthetic_child);
-  auto synthetic_child_sp = synthetic_child->GetSP();
-  synthetic_child_sp->SetName(ConstString(index_str));
-  synthetic_child_sp->m_flags.m_is_bitfield_for_scalar = true;
+  ValueObjectSP synthetic_child_sp;
+  if (IsScalarType()) {
+std::string index_str = llvm::formatv("[{0}-{1}]", from, to);
+ConstString index_const_str(index_str);
+// Check if we have already created a synthetic array member in this valid
+// object. If we have we will re-use it.
+synthetic_child_sp = 

[Lldb-commits] [lld] [mlir] [flang] [lldb] [clang-tools-extra] [llvm] [compiler-rt] [clang] [libcxx] [clang-format] Add ShortReturnTypeColumn option. (PR #78011)

2024-01-23 Thread via lldb-commits

rmarker wrote:

Merged main and fixed conflicts.
Also updated version badge to 19 with the recent branching for 18.
Keeping things up to date whilst discussion about the underlying issue 
continues on #78010.

https://github.com/llvm/llvm-project/pull/78011
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lld] [mlir] [flang] [lldb] [clang-tools-extra] [llvm] [compiler-rt] [clang] [libcxx] [clang-format] Add ShortReturnTypeColumn option. (PR #78011)

2024-01-23 Thread via lldb-commits

https://github.com/rmarker updated 
https://github.com/llvm/llvm-project/pull/78011

>From c4d28f82e108f9f12ccd0375e2a3502025b8c1e8 Mon Sep 17 00:00:00 2001
From: rmarker 
Date: Thu, 11 Jan 2024 15:01:18 +1030
Subject: [PATCH 1/4] [clang-format] Add ShortReturnTypeLength option.

---
 clang/docs/ClangFormatStyleOptions.rst |  8 
 clang/docs/ReleaseNotes.rst|  1 +
 clang/include/clang/Format/Format.h|  8 
 clang/lib/Format/ContinuationIndenter.cpp  |  3 +-
 clang/lib/Format/Format.cpp|  2 +
 clang/unittests/Format/ConfigParseTest.cpp |  1 +
 clang/unittests/Format/FormatTest.cpp  | 44 ++
 7 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/clang/docs/ClangFormatStyleOptions.rst 
b/clang/docs/ClangFormatStyleOptions.rst
index ac9a0b70ed5daa4..3255ceb0aba75b4 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -4994,6 +4994,14 @@ the configuration (without a prefix: ``Auto``).
int bar;   int bar;
  } // namespace b   } // namespace b
 
+.. _ShortReturnTypeLength:
+
+**ShortReturnTypeLength** (``Unsigned``) :versionbadge:`clang-format 18` 
:ref:`¶ `
+  When AlwaysBreakAfterReturnType is None, line breaks are prevented after
+  short return types. This configures the character limit for a type to be
+  regarded as short. Note that this isn't the length of the type itself,
+  but the column where it finishes. I.e. it includes indentation, etc.
+
 .. _SortIncludes:
 
 **SortIncludes** (``SortIncludesOptions``) :versionbadge:`clang-format 3.8` 
:ref:`¶ `
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 3cbce1be1594376..04bf5cd4e768f34 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1131,6 +1131,7 @@ clang-format
 - Add ``BreakAdjacentStringLiterals`` option.
 - Add ``ObjCPropertyAttributeOrder`` which can be used to sort ObjC property
   attributes (like ``nonatomic, strong, nullable``).
+- Add ``ShortReturnTypeLength`` option.
 - Add ``.clang-format-ignore`` files.
 - Add ``AlignFunctionPointers`` sub-option for 
``AlignConsecutiveDeclarations``.
 
diff --git a/clang/include/clang/Format/Format.h 
b/clang/include/clang/Format/Format.h
index 5ffd63ee73fc361..f94d68f2cf2a853 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -3928,6 +3928,13 @@ struct FormatStyle {
   /// \version 13
   unsigned ShortNamespaceLines;
 
+  /// When AlwaysBreakAfterReturnType is None, line breaks are prevented after
+  /// short return types. This configures the character limit for a type to be
+  /// regarded as short. Note that this isn't the length of the type itself,
+  /// but the column where it finishes. I.e. it includes indentation, etc.
+  /// \version 18
+  unsigned ShortReturnTypeLength;
+
   /// Include sorting options.
   enum SortIncludesOptions : int8_t {
 /// Includes are never sorted.
@@ -4890,6 +4897,7 @@ struct FormatStyle {
RequiresExpressionIndentation == R.RequiresExpressionIndentation &&
SeparateDefinitionBlocks == R.SeparateDefinitionBlocks &&
ShortNamespaceLines == R.ShortNamespaceLines &&
+   ShortReturnTypeLength == R.ShortReturnTypeLength &&
SortIncludes == R.SortIncludes &&
SortJavaStaticImport == R.SortJavaStaticImport &&
SpaceAfterCStyleCast == R.SpaceAfterCStyleCast &&
diff --git a/clang/lib/Format/ContinuationIndenter.cpp 
b/clang/lib/Format/ContinuationIndenter.cpp
index 102504182c4505b..bc0748ec52e6769 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -328,7 +328,8 @@ bool ContinuationIndenter::canBreak(const LineState ) 
{
 
   // Don't break after very short return types (e.g. "void") as that is often
   // unexpected.
-  if (Current.is(TT_FunctionDeclarationName) && State.Column < 6) {
+  if (Current.is(TT_FunctionDeclarationName) &&
+  State.Column <= Style.ShortReturnTypeLength) {
 if (Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None)
   return false;
   }
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index ff5ed6c306f383b..20ffbeef7e9a6e9 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1083,6 +1083,7 @@ template <> struct MappingTraits {
Style.RequiresExpressionIndentation);
 IO.mapOptional("SeparateDefinitionBlocks", Style.SeparateDefinitionBlocks);
 IO.mapOptional("ShortNamespaceLines", Style.ShortNamespaceLines);
+IO.mapOptional("ShortReturnTypeLength", Style.ShortReturnTypeLength);
 IO.mapOptional("SortIncludes", Style.SortIncludes);
 IO.mapOptional("SortJavaStaticImport", Style.SortJavaStaticImport);
 IO.mapOptional("SortUsingDeclarations", Style.SortUsingDeclarations);
@@ -1554,6 +1555,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind 

[Lldb-commits] [libc] [clang] [openmp] [lld] [clang-tools-extra] [lldb] [libcxx] [compiler-rt] [mlir] [llvm] [pstl] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Joseph Huber via lldb-commits

https://github.com/jhuber6 approved this pull request.


https://github.com/llvm/llvm-project/pull/79222
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] All ValueObjectSP instances are now valid (non-null) but have an error state (In-progress | Take 2) (PR #77375)

2024-01-23 Thread Pete Lawrence via lldb-commits

https://github.com/PortalPete converted_to_draft 
https://github.com/llvm/llvm-project/pull/77375
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [clang] [clang-tools-extra] [openmp] [lld] [libc] [libcxx] [mlir] [pstl] [compiler-rt] [llvm] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Fangrui Song via lldb-commits


@@ -0,0 +1,7 @@
+/// Some target-specific options are ignored for GPU, so %clang exits with 
code 0.
+// DEFINE: %{gpu_opts} = --cuda-gpu-arch=sm_60 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda --no-cuda-version-check
+// DEFINE: %{check} = %clang -### -c %{gpu_opts} -mcmodel=medium %s
+// RUN: %{check} -fbasic-block-sections=all
+
+// REDEFINE: %{gpu_opts} = -x hip --rocm-path=%S/Inputs/rocm -nogpulib

MaskRay wrote:

Added!

https://github.com/llvm/llvm-project/pull/79222
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [clang] [openmp] [lldb] [lld] [compiler-rt] [clang-tools-extra] [pstl] [mlir] [llvm] [libc] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Fangrui Song via lldb-commits

https://github.com/MaskRay updated 
https://github.com/llvm/llvm-project/pull/79222

>From 3a2b2a1110e7b3348a12a6476ab014a469891062 Mon Sep 17 00:00:00 2001
From: Fangrui Song 
Date: Tue, 23 Jan 2024 15:13:49 -0800
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4
---
 clang/test/Driver/unsupported-option-gpu.c | 7 +++
 1 file changed, 7 insertions(+)
 create mode 100644 clang/test/Driver/unsupported-option-gpu.c

diff --git a/clang/test/Driver/unsupported-option-gpu.c 
b/clang/test/Driver/unsupported-option-gpu.c
new file mode 100644
index 00..5713dbbfc7ae4d
--- /dev/null
+++ b/clang/test/Driver/unsupported-option-gpu.c
@@ -0,0 +1,7 @@
+/// Some target-specific options are ignored for GPU, so %clang exits with 
code 0.
+// DEFINE: %{gpu_opts} = --cuda-gpu-arch=sm_60 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda --no-cuda-version-check
+// DEFINE: %{check} = %clang -### -c %{gpu_opts} -mcmodel=medium %s
+// RUN: %{check} -fbasic-block-sections=all
+
+// REDEFINE: %{gpu_opts} = -x hip --rocm-path=%S/Inputs/rocm -nogpulib
+// RUN: %{check}

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


[Lldb-commits] [llvm] [lldb] [lld] [compiler-rt] [clang] [mlir] [libc] [libcxx] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Joseph Huber via lldb-commits


@@ -0,0 +1,7 @@
+/// Some target-specific options are ignored for GPU, so %clang exits with 
code 0.
+// DEFINE: %{gpu_opts} = --cuda-gpu-arch=sm_60 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda --no-cuda-version-check
+// DEFINE: %{check} = %clang -### -c %{gpu_opts} -mcmodel=medium %s
+// RUN: %{check} -fbasic-block-sections=all
+
+// REDEFINE: %{gpu_opts} = -x hip --rocm-path=%S/Inputs/rocm -nogpulib

jhuber6 wrote:

Should probably include `-nogpuinc` as well. Best way to avoid spurious 
failures due to lack of a local CUDA / ROCm installation. Maybe in the future 
LLVM based offloading won't depend on so much external stuff.

https://github.com/llvm/llvm-project/pull/79222
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libc] [lldb] [llvm] [mlir] [compiler-rt] [lld] [libcxx] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Fangrui Song via lldb-commits


@@ -0,0 +1,7 @@
+/// Some target-specific options are ignored for GPU, so %clang exits with 
code 0.
+// DEFINE: %{gpu_opts} = --cuda-gpu-arch=sm_60 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda --no-cuda-version-check

MaskRay wrote:

Thanks for the suggestion. Edited

https://github.com/llvm/llvm-project/pull/79222
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libc] [lldb] [llvm] [mlir] [compiler-rt] [lld] [libcxx] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Fangrui Song via lldb-commits

https://github.com/MaskRay edited 
https://github.com/llvm/llvm-project/pull/79222
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libc] [lldb] [llvm] [mlir] [compiler-rt] [lld] [libcxx] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Joseph Huber via lldb-commits


@@ -0,0 +1,7 @@
+/// Some target-specific options are ignored for GPU, so %clang exits with 
code 0.
+// DEFINE: %{gpu_opts} = --cuda-gpu-arch=sm_60 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda --no-cuda-version-check
+// DEFINE: %{check} = %clang -### -c %{gpu_opts} -mcmodel=medium %s
+// RUN: %{check} -fbasic-block-sections=all

jhuber6 wrote:

Offloading compilation for these single-source languages pretty much just 
combines one "host" compilation job with N "Device" compilation jobs. Doing 
`--offload-device-only` and `--offload-host-only` simply does one part of that. 
There's probably some flags that behave differently depending on which end 
you're compiling on, so maybe it would be useful for separating that behavior 
if needed.

https://github.com/llvm/llvm-project/pull/79222
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libc] [lldb] [llvm] [mlir] [compiler-rt] [lld] [libcxx] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Fangrui Song via lldb-commits

https://github.com/MaskRay edited 
https://github.com/llvm/llvm-project/pull/79222
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libc] [lldb] [llvm] [mlir] [compiler-rt] [lld] [libcxx] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Fangrui Song via lldb-commits

https://github.com/MaskRay edited 
https://github.com/llvm/llvm-project/pull/79222
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libc] [lldb] [llvm] [mlir] [compiler-rt] [lld] [libcxx] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Fangrui Song via lldb-commits


@@ -0,0 +1,7 @@
+/// Some target-specific options are ignored for GPU, so %clang exits with 
code 0.
+// DEFINE: %{gpu_opts} = --cuda-gpu-arch=sm_60 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda --no-cuda-version-check
+// DEFINE: %{check} = %clang -### -c %{gpu_opts} -mcmodel=medium %s
+// RUN: %{check} -fbasic-block-sections=all

MaskRay wrote:

Added `-x cuda`. The test is to show we don't get an error 
(`err_drv_unsupported_opt_for_target`) when compiling for x86_64 using a device 
(AMDGPU/NVPTX) when certain target-specified options are specified.

I am not familiar with offloading but specifying `--cuda-host-only` would 
defeat the purpose.

https://github.com/llvm/llvm-project/pull/79222
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libc] [lldb] [llvm] [mlir] [compiler-rt] [lld] [libcxx] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Fangrui Song via lldb-commits

https://github.com/MaskRay updated 
https://github.com/llvm/llvm-project/pull/79222

>From 3a2b2a1110e7b3348a12a6476ab014a469891062 Mon Sep 17 00:00:00 2001
From: Fangrui Song 
Date: Tue, 23 Jan 2024 15:13:49 -0800
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4
---
 clang/test/Driver/unsupported-option-gpu.c | 7 +++
 1 file changed, 7 insertions(+)
 create mode 100644 clang/test/Driver/unsupported-option-gpu.c

diff --git a/clang/test/Driver/unsupported-option-gpu.c 
b/clang/test/Driver/unsupported-option-gpu.c
new file mode 100644
index 00..5713dbbfc7ae4d
--- /dev/null
+++ b/clang/test/Driver/unsupported-option-gpu.c
@@ -0,0 +1,7 @@
+/// Some target-specific options are ignored for GPU, so %clang exits with 
code 0.
+// DEFINE: %{gpu_opts} = --cuda-gpu-arch=sm_60 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda --no-cuda-version-check
+// DEFINE: %{check} = %clang -### -c %{gpu_opts} -mcmodel=medium %s
+// RUN: %{check} -fbasic-block-sections=all
+
+// REDEFINE: %{gpu_opts} = -x hip --rocm-path=%S/Inputs/rocm -nogpulib
+// RUN: %{check}

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


[Lldb-commits] [clang] [libc] [libcxx] [flang] [openmp] [lld] [compiler-rt] [lldb] [clang-tools-extra] [llvm] [PGO][OpenMP] Instrumentation for GPU devices (PR #76587)

2024-01-23 Thread Ethan Luis McDonough via lldb-commits

https://github.com/EthanLuisMcDonough updated 
https://github.com/llvm/llvm-project/pull/76587

>From 530eb982b9770190377bb0bd09c5cb715f34d484 Mon Sep 17 00:00:00 2001
From: Ethan Luis McDonough 
Date: Fri, 15 Dec 2023 20:38:38 -0600
Subject: [PATCH 01/13] Add profiling functions to libomptarget

---
 .../include/llvm/Frontend/OpenMP/OMPKinds.def |  3 +++
 openmp/libomptarget/DeviceRTL/CMakeLists.txt  |  2 ++
 .../DeviceRTL/include/Profiling.h | 21 +++
 .../libomptarget/DeviceRTL/src/Profiling.cpp  | 19 +
 4 files changed, 45 insertions(+)
 create mode 100644 openmp/libomptarget/DeviceRTL/include/Profiling.h
 create mode 100644 openmp/libomptarget/DeviceRTL/src/Profiling.cpp

diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def 
b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
index d22d2a8e948b00e..1d887d5cb581276 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
@@ -503,6 +503,9 @@ __OMP_RTL(__kmpc_barrier_simple_generic, false, Void, 
IdentPtr, Int32)
 __OMP_RTL(__kmpc_warp_active_thread_mask, false, Int64,)
 __OMP_RTL(__kmpc_syncwarp, false, Void, Int64)
 
+__OMP_RTL(__llvm_profile_register_function, false, Void, VoidPtr)
+__OMP_RTL(__llvm_profile_register_names_function, false, Void, VoidPtr, Int64)
+
 __OMP_RTL(__last, false, Void, )
 
 #undef __OMP_RTL
diff --git a/openmp/libomptarget/DeviceRTL/CMakeLists.txt 
b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
index 1ce3e1e40a80ab4..55ee15d068c67b7 100644
--- a/openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
@@ -89,6 +89,7 @@ set(include_files
   ${include_directory}/Interface.h
   ${include_directory}/LibC.h
   ${include_directory}/Mapping.h
+  ${include_directory}/Profiling.h
   ${include_directory}/State.h
   ${include_directory}/Synchronization.h
   ${include_directory}/Types.h
@@ -104,6 +105,7 @@ set(src_files
   ${source_directory}/Mapping.cpp
   ${source_directory}/Misc.cpp
   ${source_directory}/Parallelism.cpp
+  ${source_directory}/Profiling.cpp
   ${source_directory}/Reduction.cpp
   ${source_directory}/State.cpp
   ${source_directory}/Synchronization.cpp
diff --git a/openmp/libomptarget/DeviceRTL/include/Profiling.h 
b/openmp/libomptarget/DeviceRTL/include/Profiling.h
new file mode 100644
index 000..68c7744cd60752f
--- /dev/null
+++ b/openmp/libomptarget/DeviceRTL/include/Profiling.h
@@ -0,0 +1,21 @@
+//=== Profiling.h - OpenMP interface -- C++ 
-*-===//
+//
+// 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
+//
+//===--===//
+//
+//
+//===--===//
+
+#ifndef OMPTARGET_DEVICERTL_PROFILING_H
+#define OMPTARGET_DEVICERTL_PROFILING_H
+
+extern "C" {
+
+void __llvm_profile_register_function(void *ptr);
+void __llvm_profile_register_names_function(void *ptr, long int i);
+}
+
+#endif
diff --git a/openmp/libomptarget/DeviceRTL/src/Profiling.cpp 
b/openmp/libomptarget/DeviceRTL/src/Profiling.cpp
new file mode 100644
index 000..799477f5e47d273
--- /dev/null
+++ b/openmp/libomptarget/DeviceRTL/src/Profiling.cpp
@@ -0,0 +1,19 @@
+//===--- Profiling.cpp  C++ 
---===//
+//
+// 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
+//
+//===--===//
+
+#include "Profiling.h"
+
+#pragma omp begin declare target device_type(nohost)
+
+extern "C" {
+
+void __llvm_profile_register_function(void *ptr) {}
+void __llvm_profile_register_names_function(void *ptr, long int i) {}
+}
+
+#pragma omp end declare target

>From fb067d4ffe604fd68cf90b705db1942bce49dbb1 Mon Sep 17 00:00:00 2001
From: Ethan Luis McDonough 
Date: Sat, 16 Dec 2023 01:18:41 -0600
Subject: [PATCH 02/13] Fix PGO instrumentation for GPU targets

---
 clang/lib/CodeGen/CodeGenPGO.cpp  | 10 --
 .../lib/Transforms/Instrumentation/InstrProfiling.cpp | 11 ---
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index 81bf8ea696b1647..edae6885b528ac7 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -959,8 +959,14 @@ void CodeGenPGO::emitCounterIncrement(CGBuilderTy 
, const Stmt *S,
 
   unsigned Counter = (*RegionCounterMap)[S];
 
-  llvm::Value *Args[] = {FuncNameVar,
- Builder.getInt64(FunctionHash),
+  // Make sure that pointer to global is passed in with zero addrspace
+  

[Lldb-commits] [libc] [openmp] [clang] [flang] [clang-tools-extra] [lldb] [libcxx] [lld] [compiler-rt] [llvm] [PGO][OpenMP] Instrumentation for GPU devices (PR #76587)

2024-01-23 Thread Ethan Luis McDonough via lldb-commits

https://github.com/EthanLuisMcDonough updated 
https://github.com/llvm/llvm-project/pull/76587

>From 530eb982b9770190377bb0bd09c5cb715f34d484 Mon Sep 17 00:00:00 2001
From: Ethan Luis McDonough 
Date: Fri, 15 Dec 2023 20:38:38 -0600
Subject: [PATCH 01/13] Add profiling functions to libomptarget

---
 .../include/llvm/Frontend/OpenMP/OMPKinds.def |  3 +++
 openmp/libomptarget/DeviceRTL/CMakeLists.txt  |  2 ++
 .../DeviceRTL/include/Profiling.h | 21 +++
 .../libomptarget/DeviceRTL/src/Profiling.cpp  | 19 +
 4 files changed, 45 insertions(+)
 create mode 100644 openmp/libomptarget/DeviceRTL/include/Profiling.h
 create mode 100644 openmp/libomptarget/DeviceRTL/src/Profiling.cpp

diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def 
b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
index d22d2a8e948b00e..1d887d5cb581276 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
@@ -503,6 +503,9 @@ __OMP_RTL(__kmpc_barrier_simple_generic, false, Void, 
IdentPtr, Int32)
 __OMP_RTL(__kmpc_warp_active_thread_mask, false, Int64,)
 __OMP_RTL(__kmpc_syncwarp, false, Void, Int64)
 
+__OMP_RTL(__llvm_profile_register_function, false, Void, VoidPtr)
+__OMP_RTL(__llvm_profile_register_names_function, false, Void, VoidPtr, Int64)
+
 __OMP_RTL(__last, false, Void, )
 
 #undef __OMP_RTL
diff --git a/openmp/libomptarget/DeviceRTL/CMakeLists.txt 
b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
index 1ce3e1e40a80ab4..55ee15d068c67b7 100644
--- a/openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
@@ -89,6 +89,7 @@ set(include_files
   ${include_directory}/Interface.h
   ${include_directory}/LibC.h
   ${include_directory}/Mapping.h
+  ${include_directory}/Profiling.h
   ${include_directory}/State.h
   ${include_directory}/Synchronization.h
   ${include_directory}/Types.h
@@ -104,6 +105,7 @@ set(src_files
   ${source_directory}/Mapping.cpp
   ${source_directory}/Misc.cpp
   ${source_directory}/Parallelism.cpp
+  ${source_directory}/Profiling.cpp
   ${source_directory}/Reduction.cpp
   ${source_directory}/State.cpp
   ${source_directory}/Synchronization.cpp
diff --git a/openmp/libomptarget/DeviceRTL/include/Profiling.h 
b/openmp/libomptarget/DeviceRTL/include/Profiling.h
new file mode 100644
index 000..68c7744cd60752f
--- /dev/null
+++ b/openmp/libomptarget/DeviceRTL/include/Profiling.h
@@ -0,0 +1,21 @@
+//=== Profiling.h - OpenMP interface -- C++ 
-*-===//
+//
+// 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
+//
+//===--===//
+//
+//
+//===--===//
+
+#ifndef OMPTARGET_DEVICERTL_PROFILING_H
+#define OMPTARGET_DEVICERTL_PROFILING_H
+
+extern "C" {
+
+void __llvm_profile_register_function(void *ptr);
+void __llvm_profile_register_names_function(void *ptr, long int i);
+}
+
+#endif
diff --git a/openmp/libomptarget/DeviceRTL/src/Profiling.cpp 
b/openmp/libomptarget/DeviceRTL/src/Profiling.cpp
new file mode 100644
index 000..799477f5e47d273
--- /dev/null
+++ b/openmp/libomptarget/DeviceRTL/src/Profiling.cpp
@@ -0,0 +1,19 @@
+//===--- Profiling.cpp  C++ 
---===//
+//
+// 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
+//
+//===--===//
+
+#include "Profiling.h"
+
+#pragma omp begin declare target device_type(nohost)
+
+extern "C" {
+
+void __llvm_profile_register_function(void *ptr) {}
+void __llvm_profile_register_names_function(void *ptr, long int i) {}
+}
+
+#pragma omp end declare target

>From fb067d4ffe604fd68cf90b705db1942bce49dbb1 Mon Sep 17 00:00:00 2001
From: Ethan Luis McDonough 
Date: Sat, 16 Dec 2023 01:18:41 -0600
Subject: [PATCH 02/13] Fix PGO instrumentation for GPU targets

---
 clang/lib/CodeGen/CodeGenPGO.cpp  | 10 --
 .../lib/Transforms/Instrumentation/InstrProfiling.cpp | 11 ---
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index 81bf8ea696b1647..edae6885b528ac7 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -959,8 +959,14 @@ void CodeGenPGO::emitCounterIncrement(CGBuilderTy 
, const Stmt *S,
 
   unsigned Counter = (*RegionCounterMap)[S];
 
-  llvm::Value *Args[] = {FuncNameVar,
- Builder.getInt64(FunctionHash),
+  // Make sure that pointer to global is passed in with zero addrspace
+  

[Lldb-commits] [flang] [libc] [clang-tools-extra] [libcxx] [llvm] [clang] [compiler-rt] [lldb] [lld] [AMDGPU][GFX12] VOP encoding and codegen - add support for v_cvt fp8/… (PR #78414)

2024-01-23 Thread Matt Arsenault via lldb-commits
Mirko =?utf-8?q?Brkušanin?= ,
Mirko =?utf-8?q?Brkušanin?= ,Mirko Brkusanin
 ,Mariusz Sikora 
Message-ID:
In-Reply-To: 


https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/78414
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libc] [flang] [clang] [clang-tools-extra] [lldb] [libcxx] [lld] [compiler-rt] [llvm] [AMDGPU][GFX12] VOP encoding and codegen - add support for v_cvt fp8/… (PR #78414)

2024-01-23 Thread Matt Arsenault via lldb-commits
Mirko =?utf-8?q?Brku=C5=A1anin?= ,
Mirko =?utf-8?q?Brku=C5=A1anin?= ,Mirko Brkusanin
 ,Mariusz Sikora 
Message-ID:
In-Reply-To: 


https://github.com/arsenm approved this pull request.


https://github.com/llvm/llvm-project/pull/78414
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [compiler-rt] [libcxx] [lldb] [flang] [libc] [lld] [llvm] [clang-tools-extra] [clang] [AMDGPU][GFX12] VOP encoding and codegen - add support for v_cvt fp8/… (PR #78414)

2024-01-23 Thread Matt Arsenault via lldb-commits
Mirko =?utf-8?q?Brkušanin?= ,
Mirko =?utf-8?q?Brkušanin?= ,Mirko Brkusanin
 ,Mariusz Sikora 
Message-ID:
In-Reply-To: 



@@ -8770,6 +8781,22 @@ void AMDGPUAsmParser::cvtVOP3DPP(MCInst , const 
OperandVector ,
   }
 }
 
+int VdstInIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::vdst_in);
+if (VdstInIdx == static_cast(Inst.getNumOperands())) {
+  Inst.addOperand(Inst.getOperand(0));
+}
+
+bool IsVOP3CvtSrDpp = Opc == AMDGPU::V_CVT_SR_BF8_F32_e64_dpp8_gfx12 ||
+  Opc == AMDGPU::V_CVT_SR_FP8_F32_e64_dpp8_gfx12 ||
+  Opc == AMDGPU::V_CVT_SR_BF8_F32_e64_dpp_gfx12 ||
+  Opc == AMDGPU::V_CVT_SR_FP8_F32_e64_dpp_gfx12;

arsenm wrote:

I don't want to hold this up for the release, but I do think this needs to be 
revisited. We should really avoid having more random lists of opcodes 

https://github.com/llvm/llvm-project/pull/78414
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Improve maintainability and readability for ValueObject methods (PR #75865)

2024-01-23 Thread Adrian Prantl via lldb-commits

https://github.com/adrian-prantl closed 
https://github.com/llvm/llvm-project/pull/75865
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] d657519 - [lldb] Improve maintainability and readability for ValueObject methods (#75865)

2024-01-23 Thread via lldb-commits

Author: Pete Lawrence
Date: 2024-01-23T16:07:52-08:00
New Revision: d657519838e4b2310e13ec5ff52599e041860825

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

LOG: [lldb] Improve maintainability and readability for ValueObject methods 
(#75865)

As I worked through changes to another PR
(https://github.com/llvm/llvm-project/pull/74912), I couldn't help but
rewrite a few methods for readability, maintainability, and possibly
some behavior correctness too.

1. Exiting early instead of nested `if`-statements, which:
- Reduces indentation levels for all subsequent lines
- Treats missing pre-conditions similar to an error
- Clearly indicates that the full length of the method is the "happy
path".
2. Explicitly return empty Value Object shared pointers for those error
(like) situations, which
- Reduces the time it takes a maintainer to figure out what the method
actually returns based on those conditions.

3. Converting a mix of `if` and `if`-`else`-statements around an enum
into one `switch` statement, which:
- Consolidates the former branching logic
- Lets the compiler warn you of a (future) missing enum case
- This one may actually change behavior slightly, because what was an
early test for one enum case, now happens later on in the `switch`.

4. Consolidating near-identical, "copy-pasta" logic into one place,
which:
- Separates the common code to the diverging paths.
- Highlights the differences between the code paths.



rdar://119833526

Added: 


Modified: 
lldb/source/Core/ValueObject.cpp

Removed: 




diff  --git a/lldb/source/Core/ValueObject.cpp 
b/lldb/source/Core/ValueObject.cpp
index 9208047be36668d..d58bf2ca763d9e2 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1582,62 +1582,64 @@ bool ValueObject::IsUninitializedReference() {
 
 ValueObjectSP ValueObject::GetSyntheticArrayMember(size_t index,
bool can_create) {
-  ValueObjectSP synthetic_child_sp;
-  if (IsPointerType() || IsArrayType()) {
-std::string index_str = llvm::formatv("[{0}]", index);
-ConstString index_const_str(index_str);
-// Check if we have already created a synthetic array member in this valid
-// object. If we have we will re-use it.
-synthetic_child_sp = GetSyntheticChild(index_const_str);
-if (!synthetic_child_sp) {
-  ValueObject *synthetic_child;
-  // We haven't made a synthetic array member for INDEX yet, so lets make
-  // one and cache it for any future reference.
-  synthetic_child = CreateChildAtIndex(0, true, index);
-
-  // Cache the value if we got one back...
-  if (synthetic_child) {
-AddSyntheticChild(index_const_str, synthetic_child);
-synthetic_child_sp = synthetic_child->GetSP();
-synthetic_child_sp->SetName(ConstString(index_str));
-synthetic_child_sp->m_flags.m_is_array_item_for_pointer = true;
-  }
-}
-  }
+  if (!IsPointerType() && !IsArrayType())
+return ValueObjectSP();
+
+  std::string index_str = llvm::formatv("[{0}]", index);
+  ConstString index_const_str(index_str);
+  // Check if we have already created a synthetic array member in this valid
+  // object. If we have we will re-use it.
+  if (auto existing_synthetic_child = GetSyntheticChild(index_const_str))
+return existing_synthetic_child;
+
+  // We haven't made a synthetic array member for INDEX yet, so lets make
+  // one and cache it for any future reference.
+  ValueObject *synthetic_child = CreateChildAtIndex(0, true, index);
+
+  if (!synthetic_child)
+return ValueObjectSP();
+
+  // Cache the synthetic child's value because it's valid.
+  AddSyntheticChild(index_const_str, synthetic_child);
+  auto synthetic_child_sp = synthetic_child->GetSP();
+  synthetic_child_sp->SetName(ConstString(index_str));
+  synthetic_child_sp->m_flags.m_is_array_item_for_pointer = true;
   return synthetic_child_sp;
 }
 
 ValueObjectSP ValueObject::GetSyntheticBitFieldChild(uint32_t from, uint32_t 
to,
  bool can_create) {
-  ValueObjectSP synthetic_child_sp;
-  if (IsScalarType()) {
-std::string index_str = llvm::formatv("[{0}-{1}]", from, to);
-ConstString index_const_str(index_str);
-// Check if we have already created a synthetic array member in this valid
-// object. If we have we will re-use it.
-synthetic_child_sp = GetSyntheticChild(index_const_str);
-if (!synthetic_child_sp) {
-  uint32_t bit_field_size = to - from + 1;
-  uint32_t bit_field_offset = from;
-  if (GetDataExtractor().GetByteOrder() == eByteOrderBig)
-bit_field_offset =
-GetByteSize().value_or(0) * 8 - 

[Lldb-commits] [llvm] [lldb] LLDB Debuginfod usage tests (with fixes) (PR #79181)

2024-01-23 Thread Kevin Frei via lldb-commits

https://github.com/kevinfrei ready_for_review 
https://github.com/llvm/llvm-project/pull/79181
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] LLDB Debuginfod usage tests (with fixes) (PR #79181)

2024-01-23 Thread Kevin Frei via lldb-commits

https://github.com/kevinfrei edited 
https://github.com/llvm/llvm-project/pull/79181
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [flang] [mlir] [llvm] [compiler-rt] [clang-tools-extra] [openmp] [libc] [lldb] [lld] [clang] AMDGPU: Add SourceOfDivergence for int_amdgcn_global_load_tr (PR #79218)

2024-01-23 Thread Changpeng Fang via lldb-commits

https://github.com/changpeng closed 
https://github.com/llvm/llvm-project/pull/79218
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [flang] [mlir] [llvm] [compiler-rt] [clang-tools-extra] [openmp] [libc] [lldb] [lld] [clang] AMDGPU: Add SourceOfDivergence for int_amdgcn_global_load_tr (PR #79218)

2024-01-23 Thread Stanislav Mekhanoshin via lldb-commits

https://github.com/rampitec approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/79218
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][NFCI] Remove unused method BreakpointIDList::FindBreakpointID(const char *, size_t *) (PR #79215)

2024-01-23 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Alex Langford (bulbazord)


Changes



---
Full diff: https://github.com/llvm/llvm-project/pull/79215.diff


2 Files Affected:

- (modified) lldb/include/lldb/Breakpoint/BreakpointIDList.h (-2) 
- (modified) lldb/source/Breakpoint/BreakpointIDList.cpp (-9) 


``diff
diff --git a/lldb/include/lldb/Breakpoint/BreakpointIDList.h 
b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
index 6c57d9bc507952f..ddf85dd78cf2e0c 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointIDList.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
@@ -45,8 +45,6 @@ class BreakpointIDList {
   // TODO: This should take a const BreakpointID.
   bool FindBreakpointID(BreakpointID _id, size_t *position) const;
 
-  bool FindBreakpointID(const char *bp_id, size_t *position) const;
-
   // Returns a pair consisting of the beginning and end of a breakpoint
   // ID range expression.  If the input string is not a valid specification,
   // returns an empty pair.
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp 
b/lldb/source/Breakpoint/BreakpointIDList.cpp
index 5ab2c9a8dc3865b..5904647314bc0c7 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -62,15 +62,6 @@ bool BreakpointIDList::FindBreakpointID(BreakpointID _id,
   return false;
 }
 
-bool BreakpointIDList::FindBreakpointID(const char *bp_id_str,
-size_t *position) const {
-  auto bp_id = BreakpointID::ParseCanonicalReference(bp_id_str);
-  if (!bp_id)
-return false;
-
-  return FindBreakpointID(*bp_id, position);
-}
-
 //  This function takes OLD_ARGS, which is usually the result of breaking the
 //  command string arguments into
 //  an array of space-separated strings, and searches through the arguments for

``




https://github.com/llvm/llvm-project/pull/79215
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][NFCI] Remove unused method BreakpointIDList::FindBreakpointID(const char *, size_t *) (PR #79215)

2024-01-23 Thread Alex Langford via lldb-commits

https://github.com/bulbazord created 
https://github.com/llvm/llvm-project/pull/79215

None

>From 0e22f21875041f98e42b8573491bf8b9cfc1e01f Mon Sep 17 00:00:00 2001
From: Alex Langford 
Date: Tue, 23 Jan 2024 13:54:00 -0800
Subject: [PATCH] [lldb][NFCI] Remove unused method
 BreakpointIDList::FindBreakpointID(const char *, size_t *)

---
 lldb/include/lldb/Breakpoint/BreakpointIDList.h | 2 --
 lldb/source/Breakpoint/BreakpointIDList.cpp | 9 -
 2 files changed, 11 deletions(-)

diff --git a/lldb/include/lldb/Breakpoint/BreakpointIDList.h 
b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
index 6c57d9bc507952..ddf85dd78cf2e0 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointIDList.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
@@ -45,8 +45,6 @@ class BreakpointIDList {
   // TODO: This should take a const BreakpointID.
   bool FindBreakpointID(BreakpointID _id, size_t *position) const;
 
-  bool FindBreakpointID(const char *bp_id, size_t *position) const;
-
   // Returns a pair consisting of the beginning and end of a breakpoint
   // ID range expression.  If the input string is not a valid specification,
   // returns an empty pair.
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp 
b/lldb/source/Breakpoint/BreakpointIDList.cpp
index 5ab2c9a8dc3865..5904647314bc0c 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -62,15 +62,6 @@ bool BreakpointIDList::FindBreakpointID(BreakpointID _id,
   return false;
 }
 
-bool BreakpointIDList::FindBreakpointID(const char *bp_id_str,
-size_t *position) const {
-  auto bp_id = BreakpointID::ParseCanonicalReference(bp_id_str);
-  if (!bp_id)
-return false;
-
-  return FindBreakpointID(*bp_id, position);
-}
-
 //  This function takes OLD_ARGS, which is usually the result of breaking the
 //  command string arguments into
 //  an array of space-separated strings, and searches through the arguments for

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


[Lldb-commits] [lldb] [lldb][NFCI] Remove unused method BreakpointIDList::AddBreakpointID(const char *) (PR #79189)

2024-01-23 Thread Alex Langford via lldb-commits

https://github.com/bulbazord closed 
https://github.com/llvm/llvm-project/pull/79189
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 6c98c5b - [lldb][NFCI] Remove unused method BreakpointIDList::AddBreakpointID(const char *) (#79189)

2024-01-23 Thread via lldb-commits

Author: Alex Langford
Date: 2024-01-23T13:41:36-08:00
New Revision: 6c98c5bd99b4c71a7895337cd4e437e023c2ec7a

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

LOG: [lldb][NFCI] Remove unused method BreakpointIDList::AddBreakpointID(const 
char *) (#79189)

This overload is completely unused.

Added: 


Modified: 
lldb/include/lldb/Breakpoint/BreakpointIDList.h
lldb/source/Breakpoint/BreakpointIDList.cpp

Removed: 




diff  --git a/lldb/include/lldb/Breakpoint/BreakpointIDList.h 
b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
index 3cda1860dc1672..6c57d9bc507952 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointIDList.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
@@ -42,8 +42,6 @@ class BreakpointIDList {
 
   bool AddBreakpointID(BreakpointID bp_id);
 
-  bool AddBreakpointID(const char *bp_id);
-
   // TODO: This should take a const BreakpointID.
   bool FindBreakpointID(BreakpointID _id, size_t *position) const;
 

diff  --git a/lldb/source/Breakpoint/BreakpointIDList.cpp 
b/lldb/source/Breakpoint/BreakpointIDList.cpp
index 51185c30dabad8..5ab2c9a8dc3865 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -48,15 +48,6 @@ bool BreakpointIDList::AddBreakpointID(BreakpointID bp_id) {
// return true.
 }
 
-bool BreakpointIDList::AddBreakpointID(const char *bp_id_str) {
-  auto bp_id = BreakpointID::ParseCanonicalReference(bp_id_str);
-  if (!bp_id)
-return false;
-
-  m_breakpoint_ids.push_back(*bp_id);
-  return true;
-}
-
 bool BreakpointIDList::FindBreakpointID(BreakpointID _id,
 size_t *position) const {
   for (size_t i = 0; i < m_breakpoint_ids.size(); ++i) {



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


[Lldb-commits] [lldb] [libclc] [libc] [clang] [compiler-rt] [mlir] [flang] [clang-tools-extra] [libcxx] [lld] [llvm] [libcxxabi] [ELF] Add internal InputFile (PR #78944)

2024-01-23 Thread Fangrui Song via lldb-commits




MaskRay wrote:

Hi, do you have more information (like a reproduce tarball) about a `file` that 
references a file of `InternalKind`? Could it be a patch in your downstream?

If `file` references a file of `InternalKind`, we probably should make it 
`nullptr` instead. But I don't know a code path where it is the case for the 
upstream lld.

https://github.com/llvm/llvm-project/pull/78944
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

2024-01-23 Thread via lldb-commits

jimingham wrote:

I see, thanks for the clarification.

In the patch, the WasmLocal and WasmGlobal calls are done in ReadRegister, so 
it seems like those are being presented as register values?  `register read` 
should show them.

BTW, we shouldn't make a top level `wasm` command, we really try hard not to 
occupy more of the "easy to type" parts of the lldb command set than we can 
help, so there is lots left free for users to customize.  There's a `language 
cplusplus` command (and on the swift fork `language swift`, so it would make 
sense to have wasm commands be vended as `language wasm`.  Then people who do a 
lot of WebAssembly debugging can make an alias to wasm if that helps.

Jim  


> On Jan 23, 2024, at 5:51 AM, Quentin Michaud ***@***.***> wrote:
> 
> 
> @jimingham  sorry if I wasn't clear. frame var 
> and target var are commands for viewing language local and global variables 
> (be it C or another one). They are indeed working with this patch. These 
> commands are using the Wasm linear memory, where most of the data about the 
> program is stored, and is similar to classical binaries memory. This linear 
> memory can be accessed using Wasm memory instructions 
> .
> 
> However for the sake of debugging Wasm, I am interested in accessing Wasm 
> local and global variables (these are the variables I meant to address in my 
> first comment). These variables are used, for example, to manage the stack 
> pointer. They are accessed using the Wasm variable instructions 
> .
> 
> The current patch allows us to inspect the Wasm linear memory as one would 
> inspect memory in a classic binary. Likewise, the Wasm code memory 
> (containing the actual Wasm bytecode, which in Wasm is separated from the 
> linear memory) is accessible with this patch with an offset of $2^{62}$. I 
> guess this is a workaround that may be explained in this comment 
> .
>  However, I'm not sure this patch provides an access to Wasm local and global 
> variables. I thought it was implemented as I saw mentions of WasmLocal and 
> WasmGlobal, but I may have mixed up with language variables.
> 
> If Wasm variables support is indeed implemented in this patch as I first 
> thought, I'm not able to see which lldb command would allow to see them. If 
> not, I think it would be a nice addition to this patch (or another patch in 
> the future) to allow one to debug Wasm instructions and variables directly. A 
> way I can see to implement that would be to use the same workaround used to 
> display the code memory with an offset, and utility commands allowing to 
> easily access variables from this offset (something like wasm local 0 to dump 
> the value of local variable n°0).
> 
> —
> Reply to this email directly, view it on GitHub 
> , or 
> unsubscribe 
> .
> You are receiving this because you were mentioned.
> 



https://github.com/llvm/llvm-project/pull/77949
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Include SBFormat.h in LLDB.h (PR #79194)

2024-01-23 Thread Alex Langford via lldb-commits

https://github.com/bulbazord closed 
https://github.com/llvm/llvm-project/pull/79194
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 7ca8feb - [lldb] Include SBFormat.h in LLDB.h (#79194)

2024-01-23 Thread via lldb-commits

Author: Alex Langford
Date: 2024-01-23T12:14:06-08:00
New Revision: 7ca8feb1b89dfe62c9c3a06aa0585adbcd019eff

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

LOG: [lldb] Include SBFormat.h in LLDB.h (#79194)

This was likely overlooked when SBFormat was added.

Added: 


Modified: 
lldb/include/lldb/API/LLDB.h

Removed: 




diff  --git a/lldb/include/lldb/API/LLDB.h b/lldb/include/lldb/API/LLDB.h
index f652d1bdb835b5..f5f1b87a046c2a 100644
--- a/lldb/include/lldb/API/LLDB.h
+++ b/lldb/include/lldb/API/LLDB.h
@@ -33,6 +33,7 @@
 #include "lldb/API/SBFile.h"
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBFileSpecList.h"
+#include "lldb/API/SBFormat.h"
 #include "lldb/API/SBFrame.h"
 #include "lldb/API/SBFunction.h"
 #include "lldb/API/SBHostOS.h"



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


[Lldb-commits] [lldb] [clang-tools-extra] [libcxx] [compiler-rt] [libc] [clang] [lld] [llvm] [flang] [AMDGPU][GFX12] VOP encoding and codegen - add support for v_cvt fp8/… (PR #78414)

2024-01-23 Thread Joe Nash via lldb-commits
Mirko =?utf-8?q?Brkušanin?= ,
Mirko =?utf-8?q?Brkušanin?= ,Mirko Brkusanin
 ,Mariusz Sikora 
Message-ID:
In-Reply-To: 


https://github.com/Sisyph commented:

DPP changes look good, and functionally I'm fine with the patch.

I don't think the tablegen 'bit IsFP8' version of managing the op_sel bits is 
any better than adding a fake src1. It doesn't scale up to any more op_sel bits 
(Hence why we can't use it for V_CVT_SR_BF8_F32_e64_dpp_gfx12) and it is a new 
abstraction, whereas we have many instances of fake src operands already. 
Consider it a +1 but not +2 from me as is, based on that.

https://github.com/llvm/llvm-project/pull/78414
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][NFCI] Remove unused method BreakpointIDList::AddBreakpointID(const char *) (PR #79189)

2024-01-23 Thread Greg Clayton via lldb-commits

https://github.com/clayborg approved this pull request.


https://github.com/llvm/llvm-project/pull/79189
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Include SBFormat.h in LLDB.h (PR #79194)

2024-01-23 Thread Greg Clayton via lldb-commits

https://github.com/clayborg approved this pull request.


https://github.com/llvm/llvm-project/pull/79194
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Include SBFormat.h in LLDB.h (PR #79194)

2024-01-23 Thread Walter Erquinigo via lldb-commits

https://github.com/walter-erquinigo approved this pull request.


https://github.com/llvm/llvm-project/pull/79194
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Include SBFormat.h in LLDB.h (PR #79194)

2024-01-23 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Alex Langford (bulbazord)


Changes

This was likely overlooked when SBFormat was added.

---
Full diff: https://github.com/llvm/llvm-project/pull/79194.diff


1 Files Affected:

- (modified) lldb/include/lldb/API/LLDB.h (+1) 


``diff
diff --git a/lldb/include/lldb/API/LLDB.h b/lldb/include/lldb/API/LLDB.h
index f652d1bdb835b5..f5f1b87a046c2a 100644
--- a/lldb/include/lldb/API/LLDB.h
+++ b/lldb/include/lldb/API/LLDB.h
@@ -33,6 +33,7 @@
 #include "lldb/API/SBFile.h"
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBFileSpecList.h"
+#include "lldb/API/SBFormat.h"
 #include "lldb/API/SBFrame.h"
 #include "lldb/API/SBFunction.h"
 #include "lldb/API/SBHostOS.h"

``




https://github.com/llvm/llvm-project/pull/79194
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Include SBFormat.h in LLDB.h (PR #79194)

2024-01-23 Thread Alex Langford via lldb-commits

https://github.com/bulbazord created 
https://github.com/llvm/llvm-project/pull/79194

This was likely overlooked when SBFormat was added.

>From d96c07d55a76d333193a033cd0516243d01e2bf4 Mon Sep 17 00:00:00 2001
From: Alex Langford 
Date: Tue, 23 Jan 2024 11:20:19 -0800
Subject: [PATCH] [lldb] Include SBFormat.h in LLDB.h

This was likely overlooked when SBFormat was added.
---
 lldb/include/lldb/API/LLDB.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lldb/include/lldb/API/LLDB.h b/lldb/include/lldb/API/LLDB.h
index f652d1bdb835b59..f5f1b87a046c2a6 100644
--- a/lldb/include/lldb/API/LLDB.h
+++ b/lldb/include/lldb/API/LLDB.h
@@ -33,6 +33,7 @@
 #include "lldb/API/SBFile.h"
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBFileSpecList.h"
+#include "lldb/API/SBFormat.h"
 #include "lldb/API/SBFrame.h"
 #include "lldb/API/SBFunction.h"
 #include "lldb/API/SBHostOS.h"

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


[Lldb-commits] [lldb] [lldb] Add support for updating string during debug process (PR #67782)

2024-01-23 Thread via lldb-commits

jimingham wrote:


> On Oct 5, 2023, at 1:05 AM, Pavel Kosov ***@***.***> wrote:
> 
> 
> BTW, I have no problem with the general direction of this change. It makes a 
> lot more sense to ask a synthetic child provider to change a value - since it 
> does represent the value of the ValueObject - rather than the summary which 
> is just some free-form text. And being able to change characters in a string 
> seems a reasonable thing to do, so switching the std::string comprehension 
> from a Summary provider to a Synthetic Child Provider is the way to do that. 
> So that part if fine.
> 
> But std::strings abound in code, and so if we're going to make this change I 
> don't think we can make that printing less space efficient, which this change 
> seems to have done. We should figure out why that's the case and fix for this 
> to be a really good change.
> 
> So, is it Ok to use current SetValueFromCString api from ValueObject to ask 
> synthetic provider to update the underlying string?
> 
I'm going to use SCP for "synthetic child provider" as I was getting tired of 
typing it out...  And I think you know most of what I'm saying here, but I 
wanted to make sure we are talking about it the same way...

Since "SetValueFromCString" is an API on ValueObject, we are free to give that 
whatever meaning makes sense.

However, I think it's confusing here to start with the model that ValueObjects 
with SCPs have "underlying strings".  The vast majority of data types 
represented by synthetic child providers have no single underlying string, they 
are mapping aggregates to aggregates or reinterpreting various regions 
(contiguous or not) of memory as though it were an aggregate of some sort.  So 
there will for the most part be no "underlying string".

More generally, we don't really do "SetValueFromCString" for aggregate types, 
only for scalar values.  So I don't see how SetValueFromCString is a useful 
general API on the aggregate type that actually holds the SCP.  You really have 
to specify the particular child you want to change.

What does makes pretty clear sense is that if SetValueFromCString is called on 
one of the synthetic children produced by the ValueObject holding the SCP, the 
child ValueObject should ask the parent's SCP: "can you change my value to the 
incoming string".  The SCP API would have to grow another interface 
"SetValueOfChildFromCString" to support this.  The SCP has to know how to do 
that in a way that round-trips (i.e. if I make a second ValueObject from the 
same variable, it will also show the changed value).  If it can do that, then 
it will make the change.  Note, it may very well have to change others of the 
synthetic child values to make that happen, depending on how the child is 
generated from the underlying data being represented.  It's also not guaranteed 
to be 1-1, since there might be many ways to change the underlying data that 
produce the requested change on the synthetic child.  We should probably decide 
whether "I can change to represent this, but not uniquely" should be an error 
or not.

> You mentioned previously that we may add SetSummaryFromCString api - in fact 
> currently this is what I am doing - changing the whole string through its 
> summary (please check attached gif for example).
> 
I think this is also a useful API though it is a bit confusingly named.  Sadly 
I can't think of a better one that isn't overly verbose.  You aren't really 
setting the summary - that's not a terribly useful operation if the underlying 
value doesn't produce that new summary when asked for it again.  It's really 
"ask the summary provider if it knows how to change the underlying data such 
that it will produce this new summary string".  But anyway, we can make this 
clear in the API docs.

By the way, as a side note, watching the part of your example where you change 
the raw string guts, it looks like we don't update summaries of a ValueObject 
if one of its children gets changed.  Be good to file bug on that one so we 
don't forget.

> But the problem with the new API is the same as for the changing characters 
> through SBValue::GetData - IDE doesn't support it
> 
In the case of std::strings, which seems to be your primary motivator here, I 
think considering the string value to be the summary makes the most sense.  
There really isn't a scalar type of "a buffer of memory starting at 0x123 and 
ending sometime later (maybe signaled by there being a `\0` somewhere)."  So 
representing std::string with a value providing SCP is not at all natural.  
Also in this case, it's useful to be able to see its raw contents easily in the 
UI as you were doing in your example, and if you swapped the std::string 
ValueObject for some kind of a "C-String" ValueObject, it would be awkward to 
get back to the raw fields.

The UI knows that it is inserting a string it got from GetSummary in that slot 
in the UI, so it can easily know to call SetSummaryFromCString when that slot 
is 

[Lldb-commits] [lldb] [lldb][NFCI] Remove unused method BreakpointIDList::AddBreakpointID(const char *) (PR #79189)

2024-01-23 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Alex Langford (bulbazord)


Changes

This overload is completely unused.

---
Full diff: https://github.com/llvm/llvm-project/pull/79189.diff


2 Files Affected:

- (modified) lldb/include/lldb/Breakpoint/BreakpointIDList.h (-2) 
- (modified) lldb/source/Breakpoint/BreakpointIDList.cpp (-9) 


``diff
diff --git a/lldb/include/lldb/Breakpoint/BreakpointIDList.h 
b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
index 3cda1860dc16721..6c57d9bc507952f 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointIDList.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
@@ -42,8 +42,6 @@ class BreakpointIDList {
 
   bool AddBreakpointID(BreakpointID bp_id);
 
-  bool AddBreakpointID(const char *bp_id);
-
   // TODO: This should take a const BreakpointID.
   bool FindBreakpointID(BreakpointID _id, size_t *position) const;
 
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp 
b/lldb/source/Breakpoint/BreakpointIDList.cpp
index 51185c30dabad8c..5ab2c9a8dc3865b 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -48,15 +48,6 @@ bool BreakpointIDList::AddBreakpointID(BreakpointID bp_id) {
// return true.
 }
 
-bool BreakpointIDList::AddBreakpointID(const char *bp_id_str) {
-  auto bp_id = BreakpointID::ParseCanonicalReference(bp_id_str);
-  if (!bp_id)
-return false;
-
-  m_breakpoint_ids.push_back(*bp_id);
-  return true;
-}
-
 bool BreakpointIDList::FindBreakpointID(BreakpointID _id,
 size_t *position) const {
   for (size_t i = 0; i < m_breakpoint_ids.size(); ++i) {

``




https://github.com/llvm/llvm-project/pull/79189
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][NFCI] Remove unused method BreakpointIDList::AddBreakpointID(const char *) (PR #79189)

2024-01-23 Thread Alex Langford via lldb-commits

https://github.com/bulbazord created 
https://github.com/llvm/llvm-project/pull/79189

This overload is completely unused.

>From c04b7a72444b167ab59604a7dce84bfadad0d45e Mon Sep 17 00:00:00 2001
From: Alex Langford 
Date: Tue, 23 Jan 2024 10:33:07 -0800
Subject: [PATCH] [lldb][NFCI] Remove unused method
 BreakpointIDList::AddBreakpointID(const char *)

This overload is completely unused.
---
 lldb/include/lldb/Breakpoint/BreakpointIDList.h | 2 --
 lldb/source/Breakpoint/BreakpointIDList.cpp | 9 -
 2 files changed, 11 deletions(-)

diff --git a/lldb/include/lldb/Breakpoint/BreakpointIDList.h 
b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
index 3cda1860dc16721..6c57d9bc507952f 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointIDList.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
@@ -42,8 +42,6 @@ class BreakpointIDList {
 
   bool AddBreakpointID(BreakpointID bp_id);
 
-  bool AddBreakpointID(const char *bp_id);
-
   // TODO: This should take a const BreakpointID.
   bool FindBreakpointID(BreakpointID _id, size_t *position) const;
 
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp 
b/lldb/source/Breakpoint/BreakpointIDList.cpp
index 51185c30dabad8c..5ab2c9a8dc3865b 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -48,15 +48,6 @@ bool BreakpointIDList::AddBreakpointID(BreakpointID bp_id) {
// return true.
 }
 
-bool BreakpointIDList::AddBreakpointID(const char *bp_id_str) {
-  auto bp_id = BreakpointID::ParseCanonicalReference(bp_id_str);
-  if (!bp_id)
-return false;
-
-  m_breakpoint_ids.push_back(*bp_id);
-  return true;
-}
-
 bool BreakpointIDList::FindBreakpointID(BreakpointID _id,
 size_t *position) const {
   for (size_t i = 0; i < m_breakpoint_ids.size(); ++i) {

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


[Lldb-commits] [libcxx] [libc] [lldb] [openmp] [clang] [mlir] [clang-tools-extra] [flang] [lld] [compiler-rt] [llvm] AMDGPU: Do not generate non-temporal hint when Load_Tr intrinsic did not specify it

2024-01-23 Thread Changpeng Fang via lldb-commits

https://github.com/changpeng closed 
https://github.com/llvm/llvm-project/pull/79104
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [llvm] [lldb] LLDB Debuginfod usage tests (with fixes) (PR #79181)

2024-01-23 Thread via lldb-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff fcff4582f01db2f5a99e3acf452aec9f2d8a126a 
2e2494f8d7d1f84c6a19537d24b88b3021be4456 -- 
lldb/test/Shell/Debuginfod/Inputs/main.c 
lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp 
llvm/lib/Debuginfod/Debuginfod.cpp
``





View the diff from clang-format here.


``diff
diff --git a/lldb/test/Shell/Debuginfod/Inputs/main.c 
b/lldb/test/Shell/Debuginfod/Inputs/main.c
index 661e5771fc..82ba5109a1 100644
--- a/lldb/test/Shell/Debuginfod/Inputs/main.c
+++ b/lldb/test/Shell/Debuginfod/Inputs/main.c
@@ -65,9 +65,7 @@ You can find the build id's in the yaml files under 
"NT_PRPSINFO" from the YAML
 
 */
 
-int func(int argc, const char **argv) {
-  return (argc + 1) * (argv[argc][0] + 2);
-}
+int func(int argc, const char **argv) { return (argc + 1) * (argv[argc][0] + 
2); }
 
 __attribute__((force_align_arg_pointer)) void _start(void) {
 

``




https://github.com/llvm/llvm-project/pull/79181
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

2024-01-23 Thread via lldb-commits

yowl wrote:

might be a noobie question, but is compatible with split dwarf ?

https://github.com/llvm/llvm-project/pull/77949
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

2024-01-23 Thread Xu Jun via lldb-commits

xujuntwt95329 wrote:

Thanks @paolosevMSFT for the great work! We have implemented debugger server in 
[WebAssembly Micro Runtime 
(WAMR)](https://github.com/bytecodealliance/wasm-micro-runtime) to work with 
this, and it works well!
![image](https://github.com/llvm/llvm-project/assets/20285361/bb2f2167-8389-4ac3-976e-8f9e6e35fe4b)

The experience of debugging dwarf-based WebAssembly modules is similar to the 
native elf, and with lldb‘s DAP tool, we can easily debug this in a UI friendly 
environment such as VSCode. This is really exciting and greatly improves the 
usability of WebAssembly  :)

Previously we maintain a huge patch file (which was created from 
@paolosevMSFT's patches) and tell the users to patch lldb source and build the 
customized lldb binary. We hope this can be upstream and shipped with official 
build, then people can enjoy debugging WebAssembly more conveniently

https://github.com/llvm/llvm-project/pull/77949
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [flang] [clang] [compiler-rt] [lldb] [libclc] [llvm] [libcxxabi] [mlir] [lld] [libcxx] [clang-tools-extra] [libc] [ELF] Add internal InputFile (PR #78944)

2024-01-23 Thread Andrew Ng via lldb-commits




nga888 wrote:

Hi @MaskRay,

I think that the addition of `ctx.internalFile` has broken this statement from 
`class InputSectionBase`:
```
// The file which contains this section. Its dynamic type is always
// ObjFile, but in order to avoid ELFT, we use InputFile as
// its static type.
InputFile *file;
```

Which can then subsequently cause assertion failures in:
```
template  ObjFile *getFile() const {
  return cast_or_null>(file);
}
```

This is happening in our downstream port of `lld`, although I haven't yet 
figured out why we are only hitting this code path.

https://github.com/llvm/llvm-project/pull/78944
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

2024-01-23 Thread Xu Jun via lldb-commits


@@ -0,0 +1,291 @@
+//===-- ProcessWasm.cpp 
---===//
+//
+// 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
+//
+//===--===//
+
+#include "ProcessWasm.h"
+#include "ThreadWasm.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Utility/DataBufferHeap.h"
+
+#include "lldb/Target/UnixSignals.h"
+#include "llvm/ADT/ArrayRef.h"
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace lldb_private::process_gdb_remote;
+using namespace lldb_private::wasm;
+
+LLDB_PLUGIN_DEFINE(ProcessWasm)
+
+// ProcessGDBRemote constructor
+ProcessWasm::ProcessWasm(lldb::TargetSP target_sp, ListenerSP listener_sp)
+: ProcessGDBRemote(target_sp, listener_sp) {
+  /* always use linux signals for wasm process */
+  m_unix_signals_sp =
+  UnixSignals::Create(ArchSpec{"wasm32-unknown-unknown-wasm"});

xujuntwt95329 wrote:

WebAssembly doesn't define its own signal system, here we simply use 
UnixSignals and expect the WebAssembly runtime always use UnixSignals on all 
platforms.

https://github.com/llvm/llvm-project/pull/77949
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

2024-01-23 Thread David Spickett via lldb-commits


@@ -0,0 +1,293 @@
+//===-- ProcessWasm.cpp 
---===//
+//
+// 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
+//
+//===--===//
+
+#include "ProcessWasm.h"
+#include "ThreadWasm.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Utility/DataBufferHeap.h"
+
+#include "lldb/Target/UnixSignals.h"
+#include "llvm/ADT/ArrayRef.h"
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace lldb_private::process_gdb_remote;
+using namespace lldb_private::wasm;
+
+LLDB_PLUGIN_DEFINE(ProcessWasm)
+
+// ProcessGDBRemote constructor
+ProcessWasm::ProcessWasm(lldb::TargetSP target_sp, ListenerSP listener_sp)
+: ProcessGDBRemote(target_sp, listener_sp) {
+  /* always use linux signals for wasm process */
+  m_unix_signals_sp =
+  UnixSignals::Create(ArchSpec{"wasm32-unknown-unknown-wasm"});
+}
+
+void ProcessWasm::Initialize() {
+  static llvm::once_flag g_once_flag;
+
+  llvm::call_once(g_once_flag, []() {
+PluginManager::RegisterPlugin(GetPluginNameStatic(),
+  GetPluginDescriptionStatic(), CreateInstance,
+  DebuggerInitialize);
+  });
+}
+
+void ProcessWasm::DebuggerInitialize(Debugger ) {
+  ProcessGDBRemote::DebuggerInitialize(debugger);
+}
+
+llvm::StringRef ProcessWasm::GetPluginName() { return GetPluginNameStatic(); }
+
+llvm::StringRef ProcessWasm::GetPluginNameStatic() {
+  static ConstString g_name("wasm");
+  return g_name;
+}
+
+llvm::StringRef ProcessWasm::GetPluginDescriptionStatic() {
+  return "GDB Remote protocol based WebAssembly debugging plug-in.";
+}
+
+void ProcessWasm::Terminate() {
+  PluginManager::UnregisterPlugin(ProcessWasm::CreateInstance);
+}
+
+lldb::ProcessSP ProcessWasm::CreateInstance(lldb::TargetSP target_sp,
+ListenerSP listener_sp,
+const FileSpec *crash_file_path,
+bool can_connect) {
+  lldb::ProcessSP process_sp;
+  if (crash_file_path == nullptr)
+process_sp = std::make_shared(target_sp, listener_sp);
+  return process_sp;
+}
+
+bool ProcessWasm::CanDebug(lldb::TargetSP target_sp,
+   bool plugin_specified_by_name) {
+  if (plugin_specified_by_name)
+return true;
+
+  Module *exe_module = target_sp->GetExecutableModulePointer();
+  if (exe_module) {
+ObjectFile *exe_objfile = exe_module->GetObjectFile();
+return exe_objfile->GetArchitecture().GetMachine() == llvm::Triple::wasm32;
+  }
+  // However, if there is no wasm module, we return false, otherwise,
+  // we might use ProcessWasm to attach gdb remote.
+  return false;
+}
+
+std::shared_ptr ProcessWasm::CreateThread(lldb::tid_t tid) {
+  return std::make_shared(*this, tid);
+}
+
+size_t ProcessWasm::ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
+   Status ) {
+  wasm_addr_t wasm_addr(vm_addr);
+
+  switch (wasm_addr.GetType()) {
+  case WasmAddressType::Memory:
+if (wasm_addr.module_id != 0) {
+  if (WasmReadMemory(wasm_addr.module_id, wasm_addr.offset, buf, size)) {
+return size;
+  }
+  error.SetErrorStringWithFormat("Wasm memory read failed for 0x%" PRIx64,
+ vm_addr);
+  return 0;
+} else {
+  return ProcessGDBRemote::ReadMemory(vm_addr, buf, size, error);
+}
+  case WasmAddressType::Code:
+wasm_addr.type = 0;

DavidSpickett wrote:

Or use the WasmAddressType::Code/Memory used elsewhere.

https://github.com/llvm/llvm-project/pull/77949
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

2024-01-23 Thread Xu Jun via lldb-commits


@@ -0,0 +1,293 @@
+//===-- ProcessWasm.cpp 
---===//
+//
+// 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
+//
+//===--===//
+
+#include "ProcessWasm.h"
+#include "ThreadWasm.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Utility/DataBufferHeap.h"
+
+#include "lldb/Target/UnixSignals.h"
+#include "llvm/ADT/ArrayRef.h"
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace lldb_private::process_gdb_remote;
+using namespace lldb_private::wasm;
+
+LLDB_PLUGIN_DEFINE(ProcessWasm)
+
+// ProcessGDBRemote constructor
+ProcessWasm::ProcessWasm(lldb::TargetSP target_sp, ListenerSP listener_sp)
+: ProcessGDBRemote(target_sp, listener_sp) {
+  /* always use linux signals for wasm process */
+  m_unix_signals_sp =
+  UnixSignals::Create(ArchSpec{"wasm32-unknown-unknown-wasm"});
+}
+
+void ProcessWasm::Initialize() {
+  static llvm::once_flag g_once_flag;
+
+  llvm::call_once(g_once_flag, []() {
+PluginManager::RegisterPlugin(GetPluginNameStatic(),
+  GetPluginDescriptionStatic(), CreateInstance,
+  DebuggerInitialize);
+  });
+}
+
+void ProcessWasm::DebuggerInitialize(Debugger ) {
+  ProcessGDBRemote::DebuggerInitialize(debugger);
+}
+
+llvm::StringRef ProcessWasm::GetPluginName() { return GetPluginNameStatic(); }
+
+llvm::StringRef ProcessWasm::GetPluginNameStatic() {
+  static ConstString g_name("wasm");
+  return g_name;
+}
+
+llvm::StringRef ProcessWasm::GetPluginDescriptionStatic() {
+  return "GDB Remote protocol based WebAssembly debugging plug-in.";
+}
+
+void ProcessWasm::Terminate() {
+  PluginManager::UnregisterPlugin(ProcessWasm::CreateInstance);
+}
+
+lldb::ProcessSP ProcessWasm::CreateInstance(lldb::TargetSP target_sp,
+ListenerSP listener_sp,
+const FileSpec *crash_file_path,
+bool can_connect) {
+  lldb::ProcessSP process_sp;
+  if (crash_file_path == nullptr)
+process_sp = std::make_shared(target_sp, listener_sp);
+  return process_sp;
+}
+
+bool ProcessWasm::CanDebug(lldb::TargetSP target_sp,
+   bool plugin_specified_by_name) {
+  if (plugin_specified_by_name)
+return true;
+
+  Module *exe_module = target_sp->GetExecutableModulePointer();
+  if (exe_module) {
+ObjectFile *exe_objfile = exe_module->GetObjectFile();
+return exe_objfile->GetArchitecture().GetMachine() == llvm::Triple::wasm32;
+  }
+  // However, if there is no wasm module, we return false, otherwise,
+  // we might use ProcessWasm to attach gdb remote.
+  return false;
+}
+
+std::shared_ptr ProcessWasm::CreateThread(lldb::tid_t tid) {
+  return std::make_shared(*this, tid);
+}
+
+size_t ProcessWasm::ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
+   Status ) {
+  wasm_addr_t wasm_addr(vm_addr);
+
+  switch (wasm_addr.GetType()) {
+  case WasmAddressType::Memory:
+if (wasm_addr.module_id != 0) {
+  if (WasmReadMemory(wasm_addr.module_id, wasm_addr.offset, buf, size)) {
+return size;
+  }
+  error.SetErrorStringWithFormat("Wasm memory read failed for 0x%" PRIx64,
+ vm_addr);
+  return 0;
+} else {
+  return ProcessGDBRemote::ReadMemory(vm_addr, buf, size, error);
+}
+  case WasmAddressType::Code:
+wasm_addr.type = 0;

xujuntwt95329 wrote:

Seems this should be `1`?

```suggestion
wasm_addr.type = 1;
```

https://github.com/llvm/llvm-project/pull/77949
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

2024-01-23 Thread David Spickett via lldb-commits

DavidSpickett wrote:

> But currently a simple gdb-remote [:] does not enable the 
> "wasm' plugin. Is there a way to detect that we are debugging WebAssembly at 
> connect time?

Tracing down from `platform connect `, I get to 
`Process::FindPlugin`, which creates a process of all the registered types then 
asks that process if it can debug that target.

Though, a lot of them just return true and you already have:
```
bool ProcessWasm::CanDebug(lldb::TargetSP target_sp,
   bool plugin_specified_by_name) {
```
So I wonder if some other plugin is saying "yes I can debug this" before the 
wasm plugin has been asked. We must register the plugins in some order but not 
sure where that is done.


https://github.com/llvm/llvm-project/pull/77949
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [flang] [clang] [compiler-rt] [libcxx] [llvm] [lld] [lldb] [clang-tools-extra] [libc] [AMDGPU][GFX12] VOP encoding and codegen - add support for v_cvt fp8/… (PR #78414)

2024-01-23 Thread Joe Nash via lldb-commits
Mirko =?utf-8?q?Brkušanin?= ,
Mirko =?utf-8?q?Brkušanin?= 
Message-ID:
In-Reply-To: 



@@ -305,6 +305,11 @@ class VOP3OpSel_gfx10 op, VOPProfile p> : 
VOP3e_gfx10 {
 
 class VOP3OpSel_gfx11_gfx12 op, VOPProfile p> : VOP3OpSel_gfx10;
 
+class VOP3FP8OpSel_gfx11_gfx12 op, VOPProfile p> : VOP3e_gfx10 
{
+  let Inst{11} = !if(p.HasSrc0, src0_modifiers{2}, 0);
+  let Inst{12} = !if(p.HasSrc0, src0_modifiers{3}, 0);

Sisyph wrote:

Thanks! I do think that patch will help a lot. I also think it handles the case 
where we use dst_op_sel to store the other bit instead of src1. If the 
CVT_F32_FP8 instruction was VOP3P, we would need a special case, but since it 
is VOP3, we want all the op_sel bits to be zero and we want dst_op_sel to be 
zero.

https://github.com/llvm/llvm-project/pull/78414
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

2024-01-23 Thread David Spickett via lldb-commits


@@ -346,6 +346,16 @@ static offset_t GetOpcodeDataSize(const DataExtractor 
,
 return (offset - data_offset) + subexpr_len;
   }
 
+  case DW_OP_WASM_location: {
+uint8_t wasm_op = data.GetU8();
+if (wasm_op == 3) {
+  data.GetU32();
+} else {
+  data.GetULEB128();
+}

DavidSpickett wrote:

(least important comment right now but...)

https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

https://github.com/llvm/llvm-project/pull/77949
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

2024-01-23 Thread Quentin Michaud via lldb-commits

mh4ck-Thales wrote:

@jimingham sorry if I wasn't clear. `frame var` and `target var` are commands 
for viewing *language* local and global variables (be it C or another one). 
They are indeed working with this patch. These commands are using the Wasm 
linear memory, where most of the data about the program is stored, and is 
similar to classical binaries memory. This linear memory can be accessed using 
Wasm [memory 
instructions](https://webassembly.github.io/spec/core/syntax/instructions.html#memory-instructions).

However for the sake of debugging Wasm, I am interested in accessing *Wasm* 
local and global variables (these are the variables I meant to address in my 
first comment). These variables are used, for example, to manage the stack 
pointer. They are accessed using the Wasm [variable 
instructions](https://webassembly.github.io/spec/core/syntax/instructions.html#variable-instructions).

The current patch allows us to inspect the Wasm linear memory as one would 
inspect memory in a classic binary. Likewise, the Wasm *code memory* 
(containing the actual Wasm bytecode, which in Wasm is separated from the 
linear memory) is accessible with this patch with an offset of $2^{62}$. I 
guess this is a workaround that may be explained in [this 
comment](https://github.com/llvm/llvm-project/pull/77949/files#diff-ab1275eefb2cafbfa3bb7a9093caf11615867bd7ff76db85949db6811b616f3cR18).
 However, I'm not sure this patch provides an access to Wasm local and global 
variables. I thought it was implemented as I saw mentions of `WasmLocal` and 
`WasmGlobal`, but I may have mixed up with language variables.

If Wasm variables support is indeed implemented in this patch as I first 
thought, I'm not able to see which lldb command would allow to see them. If 
not, I think it would be a nice addition to this patch (or another patch in the 
future) to allow one to debug Wasm instructions and variables directly. A way I 
can see to implement that would be to use the same workaround used to display 
the code memory with an offset, and utility commands allowing to easily access 
variables from this offset (something like `wasm local 0` to dump the value of 
local variable n°0).

https://github.com/llvm/llvm-project/pull/77949
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[lld] [llvm] [compiler-rt] [libcxx] [flang] [clang-tools-extra] [lldb] [libc] [clang] [AMDGPU][GFX12] VOP encoding and codegen - add support for v_cvt fp8/… (PR #78414)

2024-01-23 Thread Mirko Brkušanin via lldb-commits


@@ -305,6 +305,11 @@ class VOP3OpSel_gfx10 op, VOPProfile p> : 
VOP3e_gfx10 {
 
 class VOP3OpSel_gfx11_gfx12 op, VOPProfile p> : VOP3OpSel_gfx10;
 
+class VOP3FP8OpSel_gfx11_gfx12 op, VOPProfile p> : VOP3e_gfx10 
{
+  let Inst{11} = !if(p.HasSrc0, src0_modifiers{2}, 0);
+  let Inst{12} = !if(p.HasSrc0, src0_modifiers{3}, 0);

mbrkusanin wrote:

and llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.fp8.dpp.ll

https://github.com/llvm/llvm-project/pull/78414
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[lld] [llvm] [compiler-rt] [libcxx] [flang] [clang-tools-extra] [lldb] [libc] [clang] [AMDGPU][GFX12] VOP encoding and codegen - add support for v_cvt fp8/… (PR #78414)

2024-01-23 Thread Mirko Brkušanin via lldb-commits


@@ -305,6 +305,11 @@ class VOP3OpSel_gfx10 op, VOPProfile p> : 
VOP3e_gfx10 {
 
 class VOP3OpSel_gfx11_gfx12 op, VOPProfile p> : VOP3OpSel_gfx10;
 
+class VOP3FP8OpSel_gfx11_gfx12 op, VOPProfile p> : VOP3e_gfx10 
{
+  let Inst{11} = !if(p.HasSrc0, src0_modifiers{2}, 0);
+  let Inst{12} = !if(p.HasSrc0, src0_modifiers{3}, 0);

mbrkusanin wrote:

https://github.com/llvm/llvm-project/pull/79122 <- This should help with the 
tests in llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.fp8.dpp.mir



https://github.com/llvm/llvm-project/pull/78414
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lld] [flang] [llvm] [compiler-rt] [openmp] [lldb] [clang-tools-extra] [libcxx] [libc] [mlir] AMDGPU: Do not generate non-temporal hint when Load_Tr intrinsic did not specify it

2024-01-23 Thread Piotr Sobczak via lldb-commits


@@ -13,9 +13,8 @@ define amdgpu_kernel void @global_load_tr_b64(ptr 
addrspace(1) %addr, ptr addrsp
 ; GFX12-SDAG-W32-NEXT:s_load_b128 s[0:3], s[0:1], 0x24
 ; GFX12-SDAG-W32-NEXT:v_mov_b32_e32 v2, 0
 ; GFX12-SDAG-W32-NEXT:s_wait_kmcnt 0x0
-; GFX12-SDAG-W32-NEXT:global_load_tr_b64 v[0:1], v2, s[0:1] offset:32 
th:TH_LOAD_NT
+; GFX12-SDAG-W32-NEXT:global_load_tr_b64 v[0:1], v2, s[0:1] offset:32

piotrAMD wrote:

Thanks!

https://github.com/llvm/llvm-project/pull/79104
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [lld] [libc] [lldb] [clang-tools-extra] [clang] [openmp] [compiler-rt] [llvm] [flang] [mlir] AMDGPU: Do not generate non-temporal hint when Load_Tr intrinsic did not specify it

2024-01-23 Thread Jay Foad via lldb-commits

https://github.com/jayfoad approved this pull request.

LGTM.

https://github.com/llvm/llvm-project/pull/79104
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [mlir] [openmp] [libcxx] [flang] [clang] [clang-tools-extra] [compiler-rt] [lld] [libc] AMDGPU: Do not generate non-temporal hint when Load_Tr intrinsic did not specify it

2024-01-23 Thread Jay Foad via lldb-commits


@@ -1348,6 +1348,14 @@ bool SITargetLowering::getTgtMemIntrinsic(IntrinsicInfo 
,
   MachineMemOperand::MOVolatile;
 return true;
   }
+  case Intrinsic::amdgcn_global_load_tr: {

jayfoad wrote:

This case should also be handled in getAdrModeArguments below.

https://github.com/llvm/llvm-project/pull/79104
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [mlir] [libcxxabi] [libcxx] [flang] [clang-tools-extra] [clang] [compiler-rt] [lld] [libc] [Mips] Fix unable to handle inline assembly ends with compat-branch o… (PR #7729

2024-01-23 Thread via lldb-commits

yingopq wrote:

@topperc Hello, could you help review this patch at your convenience? Thanks.

https://github.com/llvm/llvm-project/pull/77291
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits