[Lldb-commits] [PATCH] D158971: [lldb][NFC] Put disassembler test classes and methods in anonymous namespace

2023-08-28 Thread Venkata Ramanaiah Nalamothu via Phabricator via lldb-commits
RamNalamothu created this revision.
RamNalamothu added reviewers: DavidSpickett, MaskRay.
Herald added subscribers: luke, sunshaoce, frasercrmck, luismarques, apazos, 
sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, 
MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, 
simoncook, johnrusso, rbar, asb.
Herald added a project: All.
RamNalamothu requested review of this revision.
Herald added subscribers: lldb-commits, wangpc.
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158971

Files:
  lldb/unittests/Disassembler/ARM/TestArm64Disassembly.cpp
  lldb/unittests/Disassembler/ARM/TestArmv7Disassembly.cpp
  lldb/unittests/Disassembler/RISCV/TestMCDisasmInstanceRISCV.cpp
  lldb/unittests/Disassembler/x86/TestGetControlFlowKindx86.cpp


Index: lldb/unittests/Disassembler/x86/TestGetControlFlowKindx86.cpp
===
--- lldb/unittests/Disassembler/x86/TestGetControlFlowKindx86.cpp
+++ lldb/unittests/Disassembler/x86/TestGetControlFlowKindx86.cpp
@@ -20,6 +20,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
+namespace {
 class TestGetControlFlowKindx86 : public testing::Test {
 public:
   static void SetUpTestCase();
@@ -39,6 +40,7 @@
 void TestGetControlFlowKindx86::TearDownTestCase() {
   DisassemblerLLVMC::Terminate();
 }
+} // namespace
 
 TEST_F(TestGetControlFlowKindx86, TestX86_64Instruction) {
   ArchSpec arch("x86_64-*-linux");
Index: lldb/unittests/Disassembler/RISCV/TestMCDisasmInstanceRISCV.cpp
===
--- lldb/unittests/Disassembler/RISCV/TestMCDisasmInstanceRISCV.cpp
+++ lldb/unittests/Disassembler/RISCV/TestMCDisasmInstanceRISCV.cpp
@@ -20,6 +20,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
+namespace {
 class TestMCDisasmInstanceRISCV : public testing::Test {
 public:
   static void SetUpTestCase();
@@ -39,6 +40,7 @@
 void TestMCDisasmInstanceRISCV::TearDownTestCase() {
   DisassemblerLLVMC::Terminate();
 }
+} // namespace
 
 TEST_F(TestMCDisasmInstanceRISCV, TestRISCV32Instruction) {
   ArchSpec arch("riscv32-*-linux");
Index: lldb/unittests/Disassembler/ARM/TestArmv7Disassembly.cpp
===
--- lldb/unittests/Disassembler/ARM/TestArmv7Disassembly.cpp
+++ lldb/unittests/Disassembler/ARM/TestArmv7Disassembly.cpp
@@ -20,6 +20,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
+namespace {
 class TestArmv7Disassembly : public testing::Test {
 public:
   static void SetUpTestCase();
@@ -42,6 +43,7 @@
 void TestArmv7Disassembly::TearDownTestCase() {
   DisassemblerLLVMC::Terminate();
 }
+} // namespace
 
 TEST_F(TestArmv7Disassembly, TestCortexFPDisass) {
   ArchSpec arch("armv7em--");
Index: lldb/unittests/Disassembler/ARM/TestArm64Disassembly.cpp
===
--- lldb/unittests/Disassembler/ARM/TestArm64Disassembly.cpp
+++ lldb/unittests/Disassembler/ARM/TestArm64Disassembly.cpp
@@ -20,6 +20,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
+namespace {
 class TestArm64Disassembly : public testing::Test {
 public:
   static void SetUpTestCase();
@@ -42,6 +43,7 @@
 void TestArm64Disassembly::TearDownTestCase() {
   DisassemblerLLVMC::Terminate();
 }
+} // namespace
 
 TEST_F(TestArm64Disassembly, TestArmv81Instruction) {
   ArchSpec arch("arm64-apple-ios");


Index: lldb/unittests/Disassembler/x86/TestGetControlFlowKindx86.cpp
===
--- lldb/unittests/Disassembler/x86/TestGetControlFlowKindx86.cpp
+++ lldb/unittests/Disassembler/x86/TestGetControlFlowKindx86.cpp
@@ -20,6 +20,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
+namespace {
 class TestGetControlFlowKindx86 : public testing::Test {
 public:
   static void SetUpTestCase();
@@ -39,6 +40,7 @@
 void TestGetControlFlowKindx86::TearDownTestCase() {
   DisassemblerLLVMC::Terminate();
 }
+} // namespace
 
 TEST_F(TestGetControlFlowKindx86, TestX86_64Instruction) {
   ArchSpec arch("x86_64-*-linux");
Index: lldb/unittests/Disassembler/RISCV/TestMCDisasmInstanceRISCV.cpp
===
--- lldb/unittests/Disassembler/RISCV/TestMCDisasmInstanceRISCV.cpp
+++ lldb/unittests/Disassembler/RISCV/TestMCDisasmInstanceRISCV.cpp
@@ -20,6 +20,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
+namespace {
 class TestMCDisasmInstanceRISCV : public testing::Test {
 public:
   static void SetUpTestCase();
@@ -39,6 +40,7 @@
 void TestMCDisasmInstanceRISCV::TearDownTestCase() {
   DisassemblerLLVMC::Terminate();
 }
+} // namespace
 
 TEST_F(TestMCDisasmInstanceRISCV, TestRISCV32Instruction) {
   ArchSpec arch("riscv32-*-linux");
Index: lldb/unittests/Disassembler/ARM/TestArmv7Disassembly.cpp
===
--- lldb/unitt

[Lldb-commits] [PATCH] D156817: [lldb][windows] _wsopen_s does not accept bits other than `_S_IREAD | _S_IWRITE`

2023-08-28 Thread Martin Storsjö via Phabricator via lldb-commits
mstorsjo added a comment.

I noticed this review is accepted but not committed. If you don't have commit 
access, what's your preferred git identity, i.e. `Real Name `?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156817

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


[Lldb-commits] [PATCH] D158958: [LLDB][REPL] Change the default tab size

2023-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

+ @aprantl for impact on the Swift REPL


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158958

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


[Lldb-commits] [PATCH] D158958: [LLDB][REPL] Change the default tab size

2023-08-28 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

This should probably be a language-specific setting, but I see no problem in 
doing it this way right now, since there is practically only one language.
Please update any REPL tests on the Swift branch that need updating when 
cherry-picking though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158958

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


[Lldb-commits] [PATCH] D156817: [lldb][windows] _wsopen_s does not accept bits other than `_S_IREAD | _S_IWRITE`

2023-08-28 Thread yshui via Phabricator via lldb-commits
yshui added a comment.

In D156817#4620998 , @mstorsjo wrote:

> I noticed this review is accepted but not committed. If you don't have commit 
> access, what's your preferred git identity, i.e. `Real Name `?

"Yuxuan Shui "

Thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156817

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


[Lldb-commits] [PATCH] D158785: [lldb] Add a "thread extrainfo" LC_NOTE for Mach-O corefiles, to store the thread IDs of the threads

2023-08-28 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

Thanks for the feedback @bulbazord & @JDevlieghere , I will address those 
points.

I am still trying to decide on the scope of this JSON LC_NOTE.  Right now it's 
"thread extrainfo" and a dictionary with a "threads" key by definition.  But I 
have a feeling it should be "process metadata", and currently it may contain a 
"threads" key which must be an array with the same number of elements as 
corefile has LC_THREADs, for future extension use.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158785

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


[Lldb-commits] [PATCH] D159011: [lldb][NFCI] Remove use of ConstString from UnixSignals

2023-08-28 Thread Alex Langford via Phabricator via lldb-commits
bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, mib, fdeazeve, DavidSpickett.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

The majority of UnixSignals strings are static in the sense that they do
not change. The overwhelming majority of these strings are string
literals. Using ConstString to manage their lifetime does not make
sense. The only exception to this is one of the subclasses of
UnixSignals, for which I have created a StringSet local to that file
which will guarantee the lifetimes of these StringRefs.

As for the other benefits of ConstString, string uniqueness is not a
concern (as many of them are already string literals) and comparing
signal names and aliases should not be a hot path.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159011

Files:
  lldb/include/lldb/Target/UnixSignals.h
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  lldb/source/Target/UnixSignals.cpp

Index: lldb/source/Target/UnixSignals.cpp
===
--- lldb/source/Target/UnixSignals.cpp
+++ lldb/source/Target/UnixSignals.cpp
@@ -18,17 +18,13 @@
 using namespace lldb_private;
 using namespace llvm;
 
-UnixSignals::Signal::Signal(const char *name, bool default_suppress,
+UnixSignals::Signal::Signal(llvm::StringRef name, bool default_suppress,
 bool default_stop, bool default_notify,
-const char *description, const char *alias)
-: m_name(name), m_alias(alias), m_description(),
+llvm::StringRef description, llvm::StringRef alias)
+: m_name(name), m_alias(alias), m_description(description),
   m_suppress(default_suppress), m_stop(default_stop),
-  m_notify(default_notify),
-  m_default_suppress(default_suppress), m_default_stop(default_stop),
-  m_default_notify(default_notify) {
-  if (description)
-m_description.assign(description);
-}
+  m_notify(default_notify), m_default_suppress(default_suppress),
+  m_default_stop(default_stop), m_default_notify(default_notify) {}
 
 lldb::UnixSignalsSP UnixSignals::Create(const ArchSpec &arch) {
   const auto &triple = arch.GetTriple();
@@ -104,9 +100,10 @@
   // clang-format on
 }
 
-void UnixSignals::AddSignal(int signo, const char *name, bool default_suppress,
-bool default_stop, bool default_notify,
-const char *description, const char *alias) {
+void UnixSignals::AddSignal(int signo, llvm::StringRef name,
+bool default_suppress, bool default_stop,
+bool default_notify, llvm::StringRef description,
+llvm::StringRef alias) {
   Signal new_signal(name, default_suppress, default_stop, default_notify,
 description, alias);
   m_signals.insert(std::make_pair(signo, new_signal));
@@ -135,7 +132,7 @@
   const auto pos = m_signals.find(signo);
   if (pos == m_signals.end())
 return {};
-  return pos->second.m_name.GetStringRef();
+  return pos->second.m_name;
 }
 
 std::string
@@ -147,7 +144,7 @@
 
   collection::const_iterator pos = m_signals.find(signo);
   if (pos != m_signals.end()) {
-str = pos->second.m_name.GetCString();
+str = pos->second.m_name.str();
 
 if (code) {
   std::map::const_iterator cpos =
@@ -199,14 +196,13 @@
 }
 
 int32_t UnixSignals::GetSignalNumberFromName(const char *name) const {
-  ConstString const_name(name);
+  llvm::StringRef name_ref(name);
 
   collection::const_iterator pos, end = m_signals.end();
   for (pos = m_signals.begin(); pos != end; pos++) {
-if ((const_name == pos->second.m_name) ||
-(const_name == pos->second.m_alias) ||
-(const_name == GetShortName(pos->second.m_name)) ||
-(const_name == GetShortName(pos->second.m_alias)))
+if ((name_ref == pos->second.m_name) || (name_ref == pos->second.m_alias) ||
+(name_ref == GetShortName(pos->second.m_name)) ||
+(name_ref == GetShortName(pos->second.m_alias)))
   return pos->first;
   }
 
@@ -373,11 +369,10 @@
 
 json::Value UnixSignals::GetHitCountStatistics() const {
   json::Array json_signals;
-  for (const auto &pair: m_signals) {
+  for (const auto &pair : m_signals) {
 if (pair.second.m_hit_count > 0)
-  json_signals.emplace_back(json::Object{
-{ pair.second.m_name.GetCString(), pair.second.m_hit_count }
-  });
+  json_signals.emplace_back(
+  json::Object{{pair.second.m_name, pair.second.m_hit_count}});
   }
   return std::move(json_signals);
 }
Index: lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
===
--- lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ lldb/source/Plugins/Platform/gdb-server

[Lldb-commits] [PATCH] D158863: Implement the monolithic CI pipeline in the monorepo

2023-08-28 Thread Louis Dionne via Phabricator via lldb-commits
ldionne updated this revision to Diff 554016.
ldionne marked an inline comment as done.
ldionne added a comment.
Herald added a reviewer: bollu.
Herald added subscribers: cfe-commits, libc-commits, openmp-commits, 
libcxx-commits, lldb-commits, Sanitizers, Enna1, yota9, ayermolo, jvesely.
Herald added a reviewer: rafauler.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added projects: Sanitizers, LLDB, libc++, OpenMP, libc-project, 
clang-tools-extra, Flang.
Herald added a reviewer: libc++.
This revision now requires review to proceed.

Test building all projects.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158863

Files:
  .ci/generate-buildkite-pipeline-premerge
  .ci/monolithic-linux.sh
  .ci/monolithic-windows.sh
  bolt/foo
  clang-tools-extra/foo
  compiler-rt/foo
  cross-project-tests/foo
  flang/foo
  libc/foo
  libclc/foo
  lld/foo
  lldb/foo
  llvm-libgcc/foo
  llvm/foo
  mlir/foo
  openmp/foo
  polly/foo
  pstl/foo

Index: .ci/monolithic-windows.sh
===
--- /dev/null
+++ .ci/monolithic-windows.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+#===--===##
+#
+# 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
+#
+#===--===##
+
+#
+# This script performs a monolithic build of the monorepo and runs the tests of
+# most projects on Windows. This should be replaced by per-project scripts that
+# run only the relevant tests.
+#
+
+set -ex
+set -o pipefail
+
+MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
+BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/monolithic-windows}"
+
+rm -rf ${BUILD_DIR}
+
+sccache --zero-stats
+function show-stats {
+  sccache --show-stats
+}
+trap show-stats EXIT
+
+projects="${1}"
+targets="${2}"
+
+echo "--- cmake"
+pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
+cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
+  -D LLVM_ENABLE_PROJECTS="${projects}" \
+  -G Ninja \
+  -D CMAKE_BUILD_TYPE=Release \
+  -D LLVM_ENABLE_ASSERTIONS=ON \
+  -D LLVM_BUILD_EXAMPLES=ON \
+  -D COMPILER_RT_BUILD_LIBFUZZER=OFF \
+  -D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml" \
+  -D COMPILER_RT_BUILD_ORC=OFF \
+  -D CMAKE_C_COMPILER_LAUNCHER=sccache \
+  -D CMAKE_CXX_COMPILER_LAUNCHER=sccache
+
+echo "--- ninja"
+ninja -C ${BUILD_DIR} ${targets}
Index: .ci/monolithic-linux.sh
===
--- /dev/null
+++ .ci/monolithic-linux.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+#===--===##
+#
+# 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
+#
+#===--===##
+
+#
+# This script performs a monolithic build of the monorepo and runs the tests of
+# most projects on Linux. This should be replaced by per-project scripts that
+# run only the relevant tests.
+#
+
+set -ex
+set -o pipefail
+
+MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
+BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/monolithic-linux}"
+
+rm -rf ${BUILD_DIR}
+
+ccache --zero-stats
+ccache --show-config
+function show-stats {
+  ccache --print-stats
+}
+trap show-stats EXIT
+
+projects="${1}"
+targets="${2}"
+
+echo "--- cmake"
+pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
+cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
+  -D LLVM_ENABLE_PROJECTS="${projects}" \
+  -G Ninja \
+  -D CMAKE_BUILD_TYPE=Release \
+  -D LLVM_ENABLE_ASSERTIONS=ON \
+  -D LLVM_BUILD_EXAMPLES=ON \
+  -D COMPILER_RT_BUILD_LIBFUZZER=OFF \
+  -D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml" \
+  -D LLVM_ENABLE_LLD=ON \
+  -D CMAKE_CXX_FLAGS=-gmlt \
+  -D BOLT_CLANG_EXE=/usr/bin/clang \
+  -D LLVM_CCACHE_BUILD=ON
+
+echo "--- ninja"
+ninja -C ${BUILD_DIR} ${targets}
Index: .ci/generate-buildkite-pipeline-premerge
===
--- .ci/generate-buildkite-pipeline-premerge
+++ .ci/generate-buildkite-pipeline-premerge
@@ -14,11 +14,6 @@
 # See https://buildkite.com/docs/agent/v3/cli-pipeline#pipeline-format.
 #
 
-if ! git diff --name-only HEAD~1 | grep -q -E "^libcxx/|^libcxxabi/|^libunwind/|^runtimes/|^cmake/|^clang/"; then
-  # libcxx/, libcxxabi/, libunwind/, runtimes/, cmake/ or clang/ are not affected
-  exit 0
-fi
-
 reviewID="$(git 

[Lldb-commits] [PATCH] D158863: Implement the monolithic CI pipeline in the monorepo

2023-08-28 Thread Louis Dionne via Phabricator via lldb-commits
ldionne added a comment.
Herald added a subscriber: JDevlieghere.

Sorry for spamming everyone, I'm trying to ensure that the CI will work with 
all the sub-projects in the monorepo once we move to GH PRs.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158863

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


[Lldb-commits] [PATCH] D158958: [LLDB][REPL] Change the default tab size

2023-08-28 Thread walter erquinigo via Phabricator via lldb-commits
wallace added a comment.

@aprantl, how should I proceed with the swift branch? Should I create a new 
branch in https://github.com/apple/swift and share it here so it's available 
for whoever does the merge?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158958

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


[Lldb-commits] [lldb] 8e946fe - Revert "[mlir][complex] Convert complex.abs to arith with fastmath flag"

2023-08-28 Thread Muhammad Omair Javaid via lldb-commits

Author: Muhammad Omair Javaid
Date: 2023-08-29T02:01:20+05:00
New Revision: 8e946fec0441e7a4eb4604c806afed20c6930cc4

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

LOG: Revert "[mlir][complex] Convert complex.abs to arith with fastmath flag"

This reverts commit 653f77690bb2473ff405ccc681c73217fae8b748.

This breaks lldb-aarch64-windows buildbot.
I have reproduced the issue on x86_64 Windows as well.
https://lab.llvm.org/buildbot/#/builders/219/builds/5130

Added: 
lldb/unittests/SymbolFile/PDB/Inputs/test-pdb.exe

Modified: 
mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
mlir/test/Conversion/ComplexToStandard/convert-to-standard.mlir

Removed: 




diff  --git a/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb.exe 
b/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb.exe
new file mode 100644
index 00..3a2c64504ed93c
Binary files /dev/null and b/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb.exe 
diff er

diff  --git a/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp 
b/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
index 2bcec4ea10f92c..9c05cadc2f07e0 100644
--- a/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
+++ b/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
@@ -35,18 +35,13 @@ struct AbsOpConversion : public 
OpConversionPattern {
 auto loc = op.getLoc();
 auto type = op.getType();
 
-arith::FastMathFlagsAttr fmf = op.getFastMathFlagsAttr();
-
 Value real =
 rewriter.create(loc, type, adaptor.getComplex());
 Value imag =
 rewriter.create(loc, type, adaptor.getComplex());
-Value realSqr =
-rewriter.create(loc, real, real, fmf.getValue());
-Value imagSqr =
-rewriter.create(loc, imag, imag, fmf.getValue());
-Value sqNorm =
-rewriter.create(loc, realSqr, imagSqr, fmf.getValue());
+Value realSqr = rewriter.create(loc, real, real);
+Value imagSqr = rewriter.create(loc, imag, imag);
+Value sqNorm = rewriter.create(loc, realSqr, imagSqr);
 
 rewriter.replaceOpWithNewOp(op, sqNorm);
 return success();

diff  --git a/mlir/test/Conversion/ComplexToStandard/convert-to-standard.mlir 
b/mlir/test/Conversion/ComplexToStandard/convert-to-standard.mlir
index bc2ea0dd7a5847..5e8986a4a9a464 100644
--- a/mlir/test/Conversion/ComplexToStandard/convert-to-standard.mlir
+++ b/mlir/test/Conversion/ComplexToStandard/convert-to-standard.mlir
@@ -707,19 +707,3 @@ func.func @complex_angle(%arg: complex) -> f32 {
 // CHECK: %[[IMAG:.*]] = complex.im %[[ARG]] : complex
 // CHECK: %[[RESULT:.*]] = math.atan2 %[[IMAG]], %[[REAL]] : f32
 // CHECK: return %[[RESULT]] : f32
-
-// -
-
-// CHECK-LABEL: func @complex_abs_with_fmf
-// CHECK-SAME: %[[ARG:.*]]: complex
-func.func @complex_abs_with_fmf(%arg: complex) -> f32 {
-  %abs = complex.abs %arg fastmath : complex
-  return %abs : f32
-}
-// CHECK: %[[REAL:.*]] = complex.re %[[ARG]] : complex
-// CHECK: %[[IMAG:.*]] = complex.im %[[ARG]] : complex
-// CHECK-DAG: %[[REAL_SQ:.*]] = arith.mulf %[[REAL]], %[[REAL]] 
fastmath : f32
-// CHECK-DAG: %[[IMAG_SQ:.*]] = arith.mulf %[[IMAG]], %[[IMAG]] 
fastmath : f32
-// CHECK: %[[SQ_NORM:.*]] = arith.addf %[[REAL_SQ]], %[[IMAG_SQ]] 
fastmath : f32
-// CHECK: %[[NORM:.*]] = math.sqrt %[[SQ_NORM]] : f32
-// CHECK: return %[[NORM]] : f32



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


[Lldb-commits] [PATCH] D159017: [lldb/docs] Silence warnings when generating website

2023-08-28 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib created this revision.
mib added reviewers: JDevlieghere, bulbazord, gkistanova.
mib added a project: LLDB.
Herald added a subscriber: Michael137.
Herald added a project: All.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

This patch does various things to silence the warnings that show up when
generating the website documentation.

First, this patch adds the missing definition for special member methods
in every SBAPI class. If the class cannot implement one of the special
member method, we just define it as a null operation (pass).

This should fix the following warnings:

  WARNING: missing attribute __int__ in object lldb.SB*
  WARNING: missing attribute __len__ in object lldb.SB*
  WARNING: missing attribute __hex__ in object lldb.SB*
  WARNING: missing attribute __oct__ in object lldb.SB*
  WARNING: missing attribute __iter__ in object lldb.SB*

Then, it un-skips the various `static` methods that we didn't generate
the methods for, since it's not necessary thanks to the automod-api module.

Finally, this comments out the `_static` directory in the sphinx config,
since we don't need it anymore.

Signed-off-by: Med Ismail Bennani 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159017

Files:
  lldb/bindings/interface/SBAddressExtensions.i
  lldb/bindings/interface/SBAttachInfoExtensions.i
  lldb/bindings/interface/SBBlockExtensions.i
  lldb/bindings/interface/SBBreakpointExtensions.i
  lldb/bindings/interface/SBBreakpointListExtensions.i
  lldb/bindings/interface/SBBreakpointLocationExtensions.i
  lldb/bindings/interface/SBBreakpointNameExtensions.i
  lldb/bindings/interface/SBBroadcastExtensions.i
  lldb/bindings/interface/SBCommandInterpreterExtensions.i
  lldb/bindings/interface/SBCommandInterpreterRunOptionsExtensions.i
  lldb/bindings/interface/SBCommandReturnObjectExtensions.i
  lldb/bindings/interface/SBCommunicationExtensions.i
  lldb/bindings/interface/SBCompileUnitExtensions.i
  lldb/bindings/interface/SBDataExtensions.i
  lldb/bindings/interface/SBDebuggerExtensions.i
  lldb/bindings/interface/SBDeclarationExtensions.i
  lldb/bindings/interface/SBEnvironmentExtensions.i
  lldb/bindings/interface/SBErrorExtensions.i
  lldb/bindings/interface/SBEventExtensions.i
  lldb/bindings/interface/SBExecutionContextExtensions.i
  lldb/bindings/interface/SBExpressionOptionsExtensions.i
  lldb/bindings/interface/SBFileExtensions.i
  lldb/bindings/interface/SBFileSpecExtensions.i
  lldb/bindings/interface/SBFileSpecListExtensions.i
  lldb/bindings/interface/SBFrameExtensions.i
  lldb/bindings/interface/SBFunctionExtensions.i
  lldb/bindings/interface/SBHostOSExtensions.i
  lldb/bindings/interface/SBInstructionExtensions.i
  lldb/bindings/interface/SBInstructionListExtensions.i
  lldb/bindings/interface/SBLanguageRuntimeExtensions.i
  lldb/bindings/interface/SBLaunchInfoExtensions.i
  lldb/bindings/interface/SBLineEntryExtensions.i
  lldb/bindings/interface/SBListenerExtensions.i
  lldb/bindings/interface/SBMemoryRegionInfoExtensions.i
  lldb/bindings/interface/SBMemoryRegionInfoListExtensions.i
  lldb/bindings/interface/SBModuleExtensions.i
  lldb/bindings/interface/SBModuleSpecExtensions.i
  lldb/bindings/interface/SBModuleSpecListExtensions.i
  lldb/bindings/interface/SBPlatformConnectOptionsExtensions.i
  lldb/bindings/interface/SBPlatformExtensions.i
  lldb/bindings/interface/SBPlatformShellCommandExtensions.i
  lldb/bindings/interface/SBProcessExtensions.i
  lldb/bindings/interface/SBProcessInfoExtensions.i
  lldb/bindings/interface/SBQueueExtensions.i
  lldb/bindings/interface/SBQueueItemExtensions.i
  lldb/bindings/interface/SBReproducerExtensions.i
  lldb/bindings/interface/SBScriptObjectExtensions.i
  lldb/bindings/interface/SBSectionExtensions.i
  lldb/bindings/interface/SBSourceManagerExtensions.i
  lldb/bindings/interface/SBStreamExtensions.i
  lldb/bindings/interface/SBStringListExtensions.i
  lldb/bindings/interface/SBStructuredDataExtensions.i
  lldb/bindings/interface/SBSymbolContextExtensions.i
  lldb/bindings/interface/SBSymbolContextListExtensions.i
  lldb/bindings/interface/SBSymbolExtensions.i
  lldb/bindings/interface/SBTargetExtensions.i
  lldb/bindings/interface/SBThreadCollectionExtensions.i
  lldb/bindings/interface/SBThreadExtensions.i
  lldb/bindings/interface/SBThreadPlanExtensions.i
  lldb/bindings/interface/SBTraceCursorExtensions.i
  lldb/bindings/interface/SBTraceExtensions.i
  lldb/bindings/interface/SBTypeCategoryExtensions.i
  lldb/bindings/interface/SBTypeEnumMemberExtensions.i
  lldb/bindings/interface/SBTypeExtensions.i
  lldb/bindings/interface/SBTypeFilterExtensions.i
  lldb/bindings/interface/SBTypeFormatExtensions.i
  lldb/bindings/interface/SBTypeNameSpecifierExtensions.i
  lldb/bindings/interface/SBTypeSummaryExtensions.i
  lldb/bindings/interface/SBTypeSummaryOptionsExtensions.i
  lldb/bindings/interface/SBTypeSyntheticExtensions.i
  lldb/bindings/interface/SBUnixSignalsExtensions.i
  lldb/bindings/inter

[Lldb-commits] [lldb] 47aca75 - [LLDB][REPL] Change the default tab size

2023-08-28 Thread walter erquinigo via lldb-commits

Author: walter erquinigo
Date: 2023-08-28T17:47:30-04:00
New Revision: 47aca7562abe8de378fdb88160ece9e3fcac24f4

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

LOG: [LLDB][REPL] Change the default tab size

The REPL has a default tab size of 4 spaces, which seems to be a bit too much. 
The reason is that the REPL transforms tabs into spaces, and therefore whenever 
you want to manually deindent, you need to delete at least 4 characters. On the 
other hand, using 2 as default results in less keystrokes, without hurting 
readability.

Added: 


Modified: 
lldb/source/Core/CoreProperties.td

Removed: 




diff  --git a/lldb/source/Core/CoreProperties.td 
b/lldb/source/Core/CoreProperties.td
index e3ba08dfa210fa..c7d69676f6e14c 100644
--- a/lldb/source/Core/CoreProperties.td
+++ b/lldb/source/Core/CoreProperties.td
@@ -173,8 +173,8 @@ let Definition = "debugger" in {
 Desc<"If true, LLDB will print the values of variables declared in an 
expression. Currently only supported in the REPL (default: true).">;
   def TabSize: Property<"tab-size", "UInt64">,
 Global,
-DefaultUnsignedValue<4>,
-Desc<"The tab size to use when indenting code in multi-line input mode 
(default: 4).">;
+DefaultUnsignedValue<2>,
+Desc<"The tab size to use when indenting code in multi-line input mode 
(default: 2).">;
   def EscapeNonPrintables: Property<"escape-non-printables", "Boolean">,
 Global,
 DefaultTrue,



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


[Lldb-commits] [lldb] bc0b569 - [LLDB] Fix tab size settings tests

2023-08-28 Thread walter erquinigo via lldb-commits

Author: walter erquinigo
Date: 2023-08-28T17:55:15-04:00
New Revision: bc0b5699063ef4a678e663b8aee738b4906f8719

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

LOG: [LLDB] Fix tab size settings tests

They were reported in https://lab.llvm.org/buildbot/#/builders/68/builds/58956 
and the fix is simple.

Added: 


Modified: 
lldb/test/API/commands/settings/TestSettings.py
lldb/test/Shell/Settings/TestSettingsSet.test

Removed: 




diff  --git a/lldb/test/API/commands/settings/TestSettings.py 
b/lldb/test/API/commands/settings/TestSettings.py
index 33b0e6fdeb461c..a2d845493d1df9 100644
--- a/lldb/test/API/commands/settings/TestSettings.py
+++ b/lldb/test/API/commands/settings/TestSettings.py
@@ -6,10 +6,11 @@
 import json
 import os
 import re
+
 import lldb
+from lldbsuite.test import lldbutil
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
 
 
 class SettingsCommandTestCase(TestBase):
@@ -777,7 +778,7 @@ def test_settings_clear_all(self):
 # Change a single boolean value.
 self.runCmd("settings set auto-confirm true")
 # Change a single integer value.
-self.runCmd("settings set tab-size 2")
+self.runCmd("settings set tab-size 4")
 
 # Clear everything.
 self.runCmd("settings clear --all")
@@ -792,7 +793,7 @@ def test_settings_clear_all(self):
 patterns=["^target.run-args \(arguments\) =\s*$"],
 )
 self.expect("settings show auto-confirm", substrs=["false"])
-self.expect("settings show tab-size", substrs=["4"])
+self.expect("settings show tab-size", substrs=["2"])
 
 # Check that the command fails if we combine '--all' option with any 
arguments.
 self.expect(
@@ -931,13 +932,13 @@ def test_settings_api(self):
 
 # Test basic values and embedding special JSON escaping characters.
 self.runCmd("settings set auto-confirm true")
-self.runCmd("settings set tab-size 2")
+self.runCmd("settings set tab-size 4")
 arg_value = 'hello "world"'
 self.runCmd("settings set target.arg0 %s" % arg_value)
 
 settings_json = self.get_setting_json()
 self.assertEqual(settings_json["auto-confirm"], True)
-self.assertEqual(settings_json["tab-size"], 2)
+self.assertEqual(settings_json["tab-size"], 4)
 self.assertEqual(settings_json["target"]["arg0"], arg_value)
 
 settings_data = self.get_setting_json("target.arg0")

diff  --git a/lldb/test/Shell/Settings/TestSettingsSet.test 
b/lldb/test/Shell/Settings/TestSettingsSet.test
index 8e90c00c77c2a2..59c0fa1a55d1a5 100644
--- a/lldb/test/Shell/Settings/TestSettingsSet.test
+++ b/lldb/test/Shell/Settings/TestSettingsSet.test
@@ -14,7 +14,7 @@ settings show tab-size
 
 settings set -f tab-size
 settings show tab-size
-# CHECK: tab-size (unsigned) = 4
+# CHECK: tab-size (unsigned) = 2
 
 settings set tab-size
 # CHECK: error: 'settings set' takes more arguments



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


[Lldb-commits] [PATCH] D159031: [LLDB] Fix IOHandlerEditline::GetCurrentLines()

2023-08-28 Thread walter erquinigo via Phabricator via lldb-commits
wallace created this revision.
wallace added reviewers: bulbazord, aprantl, JDevlieghere.
Herald added a project: All.
wallace requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This method was working as expected if `LLDB_ENABLE_LIBEDIT` is false, however, 
if it was true, then the variable `m_current_lines_ptr` was always pointing to 
an empty list, because Editline only updates its contents once the full input 
has been completed (see 
https://github.com/llvm/llvm-project/blob/main/lldb/source/Host/common/Editline.cpp#L1576).

A simple fix is to invoke `Editline::GetInputAsStringList()` from 
`GetCurrentLines()`, which is already used in many places as the common way to 
get the full input list.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159031

Files:
  lldb/include/lldb/Core/IOHandler.h
  lldb/include/lldb/Host/Editline.h
  lldb/source/Core/IOHandler.cpp
  lldb/source/Expression/REPL.cpp


Index: lldb/source/Expression/REPL.cpp
===
--- lldb/source/Expression/REPL.cpp
+++ lldb/source/Expression/REPL.cpp
@@ -528,17 +528,15 @@
   current_code.append(m_code.CopyList());
 
   IOHandlerEditline &editline = static_cast(io_handler);
-  const StringList *current_lines = editline.GetCurrentLines();
-  if (current_lines) {
-const uint32_t current_line_idx = editline.GetCurrentLineIndex();
-
-if (current_line_idx < current_lines->GetSize()) {
-  for (uint32_t i = 0; i < current_line_idx; ++i) {
-const char *line_cstr = current_lines->GetStringAtIndex(i);
-if (line_cstr) {
-  current_code.append("\n");
-  current_code.append(line_cstr);
-}
+  StringList current_lines = editline.GetCurrentLines();
+  const uint32_t current_line_idx = editline.GetCurrentLineIndex();
+
+  if (current_line_idx < current_lines.GetSize()) {
+for (uint32_t i = 0; i < current_line_idx; ++i) {
+  const char *line_cstr = current_lines.GetStringAtIndex(i);
+  if (line_cstr) {
+current_code.append("\n");
+current_code.append(line_cstr);
   }
 }
   }
Index: lldb/source/Core/IOHandler.cpp
===
--- lldb/source/Core/IOHandler.cpp
+++ lldb/source/Core/IOHandler.cpp
@@ -508,6 +508,16 @@
   return m_curr_line_idx;
 }
 
+StringList IOHandlerEditline::GetCurrentLines() const {
+#if LLDB_ENABLE_LIBEDIT
+  if (m_editline_up)
+return m_editline_up->GetInputAsStringList();
+#endif
+  if (m_current_lines_ptr)
+return *m_current_lines_ptr;
+  return StringList();
+}
+
 bool IOHandlerEditline::GetLines(StringList &lines, bool &interrupted) {
   m_current_lines_ptr = &lines;
 
Index: lldb/include/lldb/Host/Editline.h
===
--- lldb/include/lldb/Host/Editline.h
+++ lldb/include/lldb/Host/Editline.h
@@ -227,6 +227,9 @@
 
   void PrintAsync(Stream *stream, const char *s, size_t len);
 
+  /// Convert the current input lines into a UTF8 StringList
+  StringList GetInputAsStringList(int line_count = UINT32_MAX);
+
 private:
   /// Sets the lowest line number for multi-line editing sessions.  A value of
   /// zero suppresses
@@ -282,9 +285,6 @@
   /// Save the line currently being edited
   void SaveEditedLine();
 
-  /// Convert the current input lines into a UTF8 StringList
-  StringList GetInputAsStringList(int line_count = UINT32_MAX);
-
   /// Replaces the current multi-line session with the next entry from history.
   unsigned char RecallHistory(HistoryOperation op);
 
Index: lldb/include/lldb/Core/IOHandler.h
===
--- lldb/include/lldb/Core/IOHandler.h
+++ lldb/include/lldb/Core/IOHandler.h
@@ -403,7 +403,7 @@
 
   void SetInterruptExits(bool b) { m_interrupt_exits = b; }
 
-  const StringList *GetCurrentLines() const { return m_current_lines_ptr; }
+  StringList GetCurrentLines() const;
 
   uint32_t GetCurrentLineIndex() const;
 


Index: lldb/source/Expression/REPL.cpp
===
--- lldb/source/Expression/REPL.cpp
+++ lldb/source/Expression/REPL.cpp
@@ -528,17 +528,15 @@
   current_code.append(m_code.CopyList());
 
   IOHandlerEditline &editline = static_cast(io_handler);
-  const StringList *current_lines = editline.GetCurrentLines();
-  if (current_lines) {
-const uint32_t current_line_idx = editline.GetCurrentLineIndex();
-
-if (current_line_idx < current_lines->GetSize()) {
-  for (uint32_t i = 0; i < current_line_idx; ++i) {
-const char *line_cstr = current_lines->GetStringAtIndex(i);
-if (line_cstr) {
-  current_code.append("\n");
-  current_code.append(line_cstr);
-}
+  StringList current_lines = editline.GetCurrentLines();
+  const uint32_t current_line_idx = editline.GetCurrentLineIndex();
+
+  if (current_line_idx < 

[Lldb-commits] [PATCH] D157063: [CodeGen] Make the MachineFunctionSplitter pass testable via MIR

2023-08-28 Thread Daniel Hoekwater via Phabricator via lldb-commits
dhoekwater updated this revision to Diff 554091.
dhoekwater added a comment.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Try to replace with main to get this to work


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157063

Files:
  lldb/test/API/commands/settings/TestSettings.py
  lldb/test/Shell/Settings/TestSettingsSet.test


Index: lldb/test/Shell/Settings/TestSettingsSet.test
===
--- lldb/test/Shell/Settings/TestSettingsSet.test
+++ lldb/test/Shell/Settings/TestSettingsSet.test
@@ -14,7 +14,7 @@
 
 settings set -f tab-size
 settings show tab-size
-# CHECK: tab-size (unsigned) = 4
+# CHECK: tab-size (unsigned) = 2
 
 settings set tab-size
 # CHECK: error: 'settings set' takes more arguments
Index: lldb/test/API/commands/settings/TestSettings.py
===
--- lldb/test/API/commands/settings/TestSettings.py
+++ lldb/test/API/commands/settings/TestSettings.py
@@ -6,10 +6,11 @@
 import json
 import os
 import re
+
 import lldb
+from lldbsuite.test import lldbutil
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
 
 
 class SettingsCommandTestCase(TestBase):
@@ -777,7 +778,7 @@
 # Change a single boolean value.
 self.runCmd("settings set auto-confirm true")
 # Change a single integer value.
-self.runCmd("settings set tab-size 2")
+self.runCmd("settings set tab-size 4")
 
 # Clear everything.
 self.runCmd("settings clear --all")
@@ -792,7 +793,7 @@
 patterns=["^target.run-args \(arguments\) =\s*$"],
 )
 self.expect("settings show auto-confirm", substrs=["false"])
-self.expect("settings show tab-size", substrs=["4"])
+self.expect("settings show tab-size", substrs=["2"])
 
 # Check that the command fails if we combine '--all' option with any 
arguments.
 self.expect(
@@ -931,13 +932,13 @@
 
 # Test basic values and embedding special JSON escaping characters.
 self.runCmd("settings set auto-confirm true")
-self.runCmd("settings set tab-size 2")
+self.runCmd("settings set tab-size 4")
 arg_value = 'hello "world"'
 self.runCmd("settings set target.arg0 %s" % arg_value)
 
 settings_json = self.get_setting_json()
 self.assertEqual(settings_json["auto-confirm"], True)
-self.assertEqual(settings_json["tab-size"], 2)
+self.assertEqual(settings_json["tab-size"], 4)
 self.assertEqual(settings_json["target"]["arg0"], arg_value)
 
 settings_data = self.get_setting_json("target.arg0")


Index: lldb/test/Shell/Settings/TestSettingsSet.test
===
--- lldb/test/Shell/Settings/TestSettingsSet.test
+++ lldb/test/Shell/Settings/TestSettingsSet.test
@@ -14,7 +14,7 @@
 
 settings set -f tab-size
 settings show tab-size
-# CHECK: tab-size (unsigned) = 4
+# CHECK: tab-size (unsigned) = 2
 
 settings set tab-size
 # CHECK: error: 'settings set' takes more arguments
Index: lldb/test/API/commands/settings/TestSettings.py
===
--- lldb/test/API/commands/settings/TestSettings.py
+++ lldb/test/API/commands/settings/TestSettings.py
@@ -6,10 +6,11 @@
 import json
 import os
 import re
+
 import lldb
+from lldbsuite.test import lldbutil
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
 
 
 class SettingsCommandTestCase(TestBase):
@@ -777,7 +778,7 @@
 # Change a single boolean value.
 self.runCmd("settings set auto-confirm true")
 # Change a single integer value.
-self.runCmd("settings set tab-size 2")
+self.runCmd("settings set tab-size 4")
 
 # Clear everything.
 self.runCmd("settings clear --all")
@@ -792,7 +793,7 @@
 patterns=["^target.run-args \(arguments\) =\s*$"],
 )
 self.expect("settings show auto-confirm", substrs=["false"])
-self.expect("settings show tab-size", substrs=["4"])
+self.expect("settings show tab-size", substrs=["2"])
 
 # Check that the command fails if we combine '--all' option with any arguments.
 self.expect(
@@ -931,13 +932,13 @@
 
 # Test basic values and embedding special JSON escaping characters.
 self.runCmd("settings set auto-confirm true")
-self.runCmd("settings set tab-size 2")
+self.runCmd("settings set tab-size 4")
 arg_value = 'hello "world"'
 self.runCmd("settings set target.arg0 %s" % arg_value)
 
 settings_json = self.get_setting_json()
 self.assertEqual(settings_json["auto-confirm"], True)
-self.assertEqual(settings_json["ta

[Lldb-commits] [PATCH] D157063: [CodeGen] Make the MachineFunctionSplitter pass testable via MIR

2023-08-28 Thread Daniel Hoekwater via Phabricator via lldb-commits
dhoekwater updated this revision to Diff 554092.
dhoekwater added a comment.
Herald added a subscriber: JDevlieghere.

Try to replace with a different branch to get this to work


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157063

Files:
  llvm/include/llvm/CodeGen/TargetInstrInfo.h
  llvm/lib/CodeGen/MachineFunctionSplitter.cpp
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/lib/Target/AArch64/AArch64InstrInfo.h
  llvm/test/CodeGen/Generic/machine-function-splitter.ll

Index: llvm/test/CodeGen/Generic/machine-function-splitter.ll
===
--- llvm/test/CodeGen/Generic/machine-function-splitter.ll
+++ llvm/test/CodeGen/Generic/machine-function-splitter.ll
@@ -517,6 +517,91 @@
   ret i32 %tmp2
 }
 
+define i32 @foo18(i32 %in) !prof !14 !section_prefix !15 {
+;; Check that a cold block targeted by a jump table is not split
+;; on AArch64.
+; MFS-DEFAULTS-LABEL:foo18
+; MFS-DEFAULTS:  .section.text.split.foo18
+; MFS-DEFAULTS-NEXT: foo18.cold:
+; MFS-DEFAULTS-SAME:   %common.ret
+; MFS-DEFAULTS-X86-DAG:jmp qux
+; MFS-DEFAULTS-X86-DAG:jmp bam
+; MFS-DEFAULTS-AARCH64-NOT:b   bar
+; MFS-DEFAULTS-AARCH64-NOT:b   baz
+; MFS-DEFAULTS-AARCH64-NOT:b   qux
+; MFS-DEFAULTS-AARCH64-NOT:b   bam
+
+  switch i32 %in, label %common.ret [
+i32 0, label %hot1
+i32 1, label %hot2
+i32 2, label %cold1
+i32 3, label %cold2
+  ], !prof !28
+
+common.ret:   ; preds = %0
+  ret i32 0
+
+hot1: ; preds = %0
+  %1 = tail call i32 @bar()
+  ret i32 %1
+
+hot2: ; preds = %0
+  %2 = tail call i32 @baz()
+  ret i32 %2
+
+cold1:; preds = %0
+  %3 = tail call i32 @bam()
+  ret i32 %3
+
+cold2:; preds = %0
+  %4 = tail call i32 @qux()
+  ret i32 %4
+}
+
+define i32 @foo19(i32 %in) !prof !14 !section_prefix !15 {
+;; Check that a cold block that contains a jump table dispatch is
+;; not split on AArch64.
+; MFS-DEFAULTS-LABEL:foo19
+; MFS-DEFAULTS:  .section.text.split.foo19
+; MFS-DEFAULTS-NEXT: foo19.cold:
+; MFS-DEFAULTS-X86:.LJTI18_0
+; MFS-DEFAULTS-AARCH64-NOT:.LJTI18_0
+; MFS-DEFAULTS:  .section.rodata
+; MFS-DEFAULTS:.LJTI18_0
+  %cmp = icmp sgt i32 %in, 3
+  br i1 %cmp, label %hot, label %cold_switch, !prof !17
+
+hot:  ; preds = %0
+ret i32 1
+
+cold_switch:  ; preds = %0
+  switch i32 %in, label %common.ret [
+i32 0, label %hot1
+i32 1, label %hot2
+i32 2, label %cold1
+i32 3, label %cold2
+  ], !prof !28
+
+common.ret:   ; preds = %0
+  ret i32 0
+
+hot1: ; preds = %0
+  %1 = tail call i32 @bar()
+  ret i32 %1
+
+hot2: ; preds = %0
+  %2 = tail call i32 @baz()
+  ret i32 %2
+
+cold1:; preds = %0
+  %3 = tail call i32 @bam()
+  ret i32 %3
+
+cold2:; preds = %0
+  %4 = tail call i32 @qux()
+  ret i32 %4
+}
+
 declare i32 @bar()
 declare i32 @baz()
 declare i32 @bam()
@@ -557,3 +642,4 @@
 !25 = !{!"branch_weights", i32 0, i32 7000}
 !26 = !{!"branch_weights", i32 1000, i32 6000}
 !27 = !{!"function_entry_count", i64 1}
+!28 = !{!"branch_weights", i32 0, i32 4000, i32 4000, i32 0, i32 0}
Index: llvm/lib/Target/AArch64/AArch64InstrInfo.h
===
--- llvm/lib/Target/AArch64/AArch64InstrInfo.h
+++ llvm/lib/Target/AArch64/AArch64InstrInfo.h
@@ -338,6 +338,8 @@
 
   bool isFunctionSafeToSplit(const MachineFunction &MF) const override;
 
+  bool isMBBSafeToSplitToCold(const MachineBasicBlock &MBB) const override;
+
   std::optional
   describeLoadedValue(const MachineInstr &MI, Register Reg) const override;
 
Index: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
===
--- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -8406,6 +8406,36 @@
   return TargetInstrInfo::isFunctionSafeToSplit(MF);
 }
 
+bool AArch64InstrInfo::isMBBSafeToSplitToCold(
+const MachineBasicBlock &MBB) const {
+  // Because jump tables are label-relative instead of table-relative, they all
+  // must be in the same section or relocation fixup handling will fail.
+
+  // Check if MBB is a jump table target
+  const MachineJumpTableInfo *MJTI = MBB.getParent()->getJumpTableInfo();
+  auto containsMBB = [&MBB](const MachineJumpTableEntry 

[Lldb-commits] [PATCH] D157063: [CodeGen] Make the MachineFunctionSplitter pass testable via MIR

2023-08-28 Thread Daniel Hoekwater via Phabricator via lldb-commits
dhoekwater updated this revision to Diff 554093.
dhoekwater added a comment.

Try to replace with yet another


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157063

Files:
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/test/CodeGen/Generic/machine-function-splitter.ll


Index: llvm/test/CodeGen/Generic/machine-function-splitter.ll
===
--- llvm/test/CodeGen/Generic/machine-function-splitter.ll
+++ llvm/test/CodeGen/Generic/machine-function-splitter.ll
@@ -602,6 +602,33 @@
   ret i32 %4
 }
 
+define void @foo20(i1 zeroext %0) !prof !14 !section_prefix !15 {
+;; Check that blocks containing or targeted by asm goto aren't split.
+; MFS-DEFAULTS-LABEL:foo20
+; MFS-DEFAULTS-AARCH64-NOT:  foo20.cold:
+; MFS-DEFAULTS-X86:  .section.text.split.foo20
+; MFS-DEFAULTS-X86:  foo20.cold:
+; MFS-DEFAULTS-X86-DAG:  # %cold_asm
+; MFS-DEFAULTS-X86-DAG:  # %cold_asm_target
+
+  br i1 %0, label %hot, label %cold_asm, !prof !17
+
+hot:
+  %2 = call i32 @bar()
+  ret void
+
+cold_asm:
+callbr void asm sideeffect "nop", "!i"() #3
+  to label %asm.fallthrough [label %cold_asm_target]
+
+asm.fallthrough:
+br label %cold_asm_target
+
+cold_asm_target:
+  %3 = call i32 @baz()
+  ret void
+}
+
 declare i32 @bar()
 declare i32 @baz()
 declare i32 @bam()
Index: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
===
--- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -8432,6 +8432,14 @@
 }
   }
 
+  // Asm Goto blocks can contain conditional branches to goto labels, which can
+  // get moved out of range of the branch instruction.
+  auto isAsmGoto = [](const MachineInstr &MI) {
+return MI.getOpcode() == AArch64::INLINEASM_BR;
+  };
+  if (llvm::any_of(MBB, isAsmGoto) || MBB.isInlineAsmBrIndirectTarget())
+return false;
+
   // MBB isn't a special case, so it's safe to be split to the cold section.
   return true;
 }


Index: llvm/test/CodeGen/Generic/machine-function-splitter.ll
===
--- llvm/test/CodeGen/Generic/machine-function-splitter.ll
+++ llvm/test/CodeGen/Generic/machine-function-splitter.ll
@@ -602,6 +602,33 @@
   ret i32 %4
 }
 
+define void @foo20(i1 zeroext %0) !prof !14 !section_prefix !15 {
+;; Check that blocks containing or targeted by asm goto aren't split.
+; MFS-DEFAULTS-LABEL:foo20
+; MFS-DEFAULTS-AARCH64-NOT:  foo20.cold:
+; MFS-DEFAULTS-X86:  .section.text.split.foo20
+; MFS-DEFAULTS-X86:  foo20.cold:
+; MFS-DEFAULTS-X86-DAG:  # %cold_asm
+; MFS-DEFAULTS-X86-DAG:  # %cold_asm_target
+
+  br i1 %0, label %hot, label %cold_asm, !prof !17
+
+hot:
+  %2 = call i32 @bar()
+  ret void
+
+cold_asm:
+callbr void asm sideeffect "nop", "!i"() #3
+  to label %asm.fallthrough [label %cold_asm_target]
+
+asm.fallthrough:
+br label %cold_asm_target
+
+cold_asm_target:
+  %3 = call i32 @baz()
+  ret void
+}
+
 declare i32 @bar()
 declare i32 @baz()
 declare i32 @bam()
Index: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
===
--- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -8432,6 +8432,14 @@
 }
   }
 
+  // Asm Goto blocks can contain conditional branches to goto labels, which can
+  // get moved out of range of the branch instruction.
+  auto isAsmGoto = [](const MachineInstr &MI) {
+return MI.getOpcode() == AArch64::INLINEASM_BR;
+  };
+  if (llvm::any_of(MBB, isAsmGoto) || MBB.isInlineAsmBrIndirectTarget())
+return false;
+
   // MBB isn't a special case, so it's safe to be split to the cold section.
   return true;
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D159017: [lldb/docs] Silence warnings when generating website

2023-08-28 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib updated this revision to Diff 554102.

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

https://reviews.llvm.org/D159017

Files:
  lldb/bindings/interface/SBAddressExtensions.i
  lldb/bindings/interface/SBAttachInfoExtensions.i
  lldb/bindings/interface/SBBlockExtensions.i
  lldb/bindings/interface/SBBreakpointExtensions.i
  lldb/bindings/interface/SBBreakpointListExtensions.i
  lldb/bindings/interface/SBBreakpointLocationExtensions.i
  lldb/bindings/interface/SBBreakpointNameExtensions.i
  lldb/bindings/interface/SBBroadcastExtensions.i
  lldb/bindings/interface/SBCommandInterpreterExtensions.i
  lldb/bindings/interface/SBCommandInterpreterRunOptionsExtensions.i
  lldb/bindings/interface/SBCommandReturnObjectExtensions.i
  lldb/bindings/interface/SBCommunicationExtensions.i
  lldb/bindings/interface/SBCompileUnitExtensions.i
  lldb/bindings/interface/SBDataExtensions.i
  lldb/bindings/interface/SBDebuggerExtensions.i
  lldb/bindings/interface/SBDeclarationExtensions.i
  lldb/bindings/interface/SBEnvironmentExtensions.i
  lldb/bindings/interface/SBErrorExtensions.i
  lldb/bindings/interface/SBEventExtensions.i
  lldb/bindings/interface/SBExecutionContextExtensions.i
  lldb/bindings/interface/SBExpressionOptionsExtensions.i
  lldb/bindings/interface/SBFileExtensions.i
  lldb/bindings/interface/SBFileSpecExtensions.i
  lldb/bindings/interface/SBFileSpecListExtensions.i
  lldb/bindings/interface/SBFrameExtensions.i
  lldb/bindings/interface/SBFunctionExtensions.i
  lldb/bindings/interface/SBHostOSExtensions.i
  lldb/bindings/interface/SBInstructionExtensions.i
  lldb/bindings/interface/SBInstructionListExtensions.i
  lldb/bindings/interface/SBLanguageRuntimeExtensions.i
  lldb/bindings/interface/SBLaunchInfoExtensions.i
  lldb/bindings/interface/SBLineEntryExtensions.i
  lldb/bindings/interface/SBListenerExtensions.i
  lldb/bindings/interface/SBMemoryRegionInfoExtensions.i
  lldb/bindings/interface/SBMemoryRegionInfoListExtensions.i
  lldb/bindings/interface/SBModuleExtensions.i
  lldb/bindings/interface/SBModuleSpecExtensions.i
  lldb/bindings/interface/SBModuleSpecListExtensions.i
  lldb/bindings/interface/SBPlatformConnectOptionsExtensions.i
  lldb/bindings/interface/SBPlatformExtensions.i
  lldb/bindings/interface/SBPlatformShellCommandExtensions.i
  lldb/bindings/interface/SBProcessDocstrings.i
  lldb/bindings/interface/SBProcessExtensions.i
  lldb/bindings/interface/SBProcessInfoExtensions.i
  lldb/bindings/interface/SBQueueExtensions.i
  lldb/bindings/interface/SBQueueItemExtensions.i
  lldb/bindings/interface/SBReproducerExtensions.i
  lldb/bindings/interface/SBScriptObjectExtensions.i
  lldb/bindings/interface/SBSectionExtensions.i
  lldb/bindings/interface/SBSourceManagerExtensions.i
  lldb/bindings/interface/SBStreamExtensions.i
  lldb/bindings/interface/SBStringListExtensions.i
  lldb/bindings/interface/SBStructuredDataExtensions.i
  lldb/bindings/interface/SBSymbolContextExtensions.i
  lldb/bindings/interface/SBSymbolContextListExtensions.i
  lldb/bindings/interface/SBSymbolExtensions.i
  lldb/bindings/interface/SBTargetExtensions.i
  lldb/bindings/interface/SBThreadCollectionExtensions.i
  lldb/bindings/interface/SBThreadExtensions.i
  lldb/bindings/interface/SBThreadPlanExtensions.i
  lldb/bindings/interface/SBTraceCursorExtensions.i
  lldb/bindings/interface/SBTraceExtensions.i
  lldb/bindings/interface/SBTypeCategoryExtensions.i
  lldb/bindings/interface/SBTypeEnumMemberExtensions.i
  lldb/bindings/interface/SBTypeExtensions.i
  lldb/bindings/interface/SBTypeFilterExtensions.i
  lldb/bindings/interface/SBTypeFormatExtensions.i
  lldb/bindings/interface/SBTypeNameSpecifierExtensions.i
  lldb/bindings/interface/SBTypeSummaryExtensions.i
  lldb/bindings/interface/SBTypeSummaryOptionsExtensions.i
  lldb/bindings/interface/SBTypeSyntheticExtensions.i
  lldb/bindings/interface/SBUnixSignalsExtensions.i
  lldb/bindings/interface/SBValueExtensions.i
  lldb/bindings/interface/SBValueListExtensions.i
  lldb/bindings/interface/SBVariablesOptionsExtensions.i
  lldb/bindings/interface/SBWatchpointExtensions.i
  lldb/bindings/interfaces.swig
  lldb/bindings/python/python-extensions.swig
  lldb/bindings/python/python.swig
  lldb/docs/conf.py
  lldb/docs/python_api.rst

Index: lldb/docs/python_api.rst
===
--- lldb/docs/python_api.rst
+++ lldb/docs/python_api.rst
@@ -5,94 +5,10 @@
   The long list of "skip" filters out several global functions that are
   generated by SWIG (but which are not useful as they are only the
   backend for their respective static functions in the classes).
-  Without this list
 .. automodapi:: lldb
   :no-inheritance-diagram:
-  :skip: SBBreakpoint_EventIsBreakpointEvent
-  :skip: SBBreakpoint_GetBreakpointEventTypeFromEvent
-  :skip: SBBreakpoint_GetBreakpointFromEvent
-  :skip: SBBreakpoint_GetBreakpointLocationAtIndexFromEvent
-  :skip: SBBreakpoint_GetNumBreakpointLocationsFromEvent
-  :skip: 

[Lldb-commits] [PATCH] D159017: [lldb/docs] Silence warnings when generating website

2023-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

Overall this LGTM. It's really unfortunate we have to define things like 
`__hex__` for every class. Is there a way to either (1) silence this warning on 
(2) have SWIG generate this for us?


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

https://reviews.llvm.org/D159017

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