Skip to content

Commit 9c93562

Browse files
committed
merge main into amd-staging
2 parents 944ce1f + 74f69c4 commit 9c93562

File tree

86 files changed

+2681
-963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2681
-963
lines changed

flang/test/Integration/OpenMP/atomic-capture-complex.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
!RUN: %if x86-registered-target %{ %flang_fc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fopenmp %s -o - | FileCheck --check-prefixes=CHECK,X86 %s %}
1010
!RUN: %if aarch64-registerd-target %{ %flang_fc1 -triple aarch64-unknown-linux-gnu -emit-llvm -fopenmp %s -o - | FileCheck --check-prefixes=CHECK,AARCH64 %s %}
1111

12+
!CHECK: %[[ATOMIC_TEMP_LOAD:.*]] = alloca { float, float }, align 8
1213
!CHECK: %[[X_NEW_VAL:.*]] = alloca { float, float }, align 8
1314
!CHECK: %[[VAL_1:.*]] = alloca { float, float }, i64 1, align 8
1415
!CHECK: %[[ORIG_VAL:.*]] = alloca { float, float }, i64 1, align 8
1516
!CHECK: store { float, float } { float 2.000000e+00, float 2.000000e+00 }, ptr %[[ORIG_VAL]], align 4
1617
!CHECK: br label %entry
1718

1819
!CHECK: entry:
19-
!CHECK: %[[ATOMIC_TEMP_LOAD:.*]] = alloca { float, float }, align 8
2020
!CHECK: call void @__atomic_load(i64 8, ptr %[[ORIG_VAL]], ptr %[[ATOMIC_TEMP_LOAD]], i32 0)
2121
!CHECK: %[[PHI_NODE_ENTRY_1:.*]] = load { float, float }, ptr %[[ATOMIC_TEMP_LOAD]], align 8
2222
!CHECK: br label %.atomic.cont
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//===-- Square root of IEEE 754 floating point numbers ----------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_AARCH64_SQRT_H
10+
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_AARCH64_SQRT_H
11+
12+
#include "src/__support/common.h"
13+
#include "src/__support/macros/config.h"
14+
#include "src/__support/macros/properties/architectures.h"
15+
#include "src/__support/macros/properties/cpu_features.h"
16+
17+
#if !defined(LIBC_TARGET_ARCH_IS_AARCH64)
18+
#error "Invalid include"
19+
#endif
20+
21+
namespace LIBC_NAMESPACE_DECL {
22+
namespace fputil {
23+
24+
#ifdef LIBC_TARGET_CPU_HAS_FPU_FLOAT
25+
template <> LIBC_INLINE float sqrt<float>(float x) {
26+
float y;
27+
asm("fsqrt %s0, %s1\n\t" : "=w"(y) : "w"(x));
28+
return y;
29+
}
30+
#endif // LIBC_TARGET_CPU_HAS_FPU_FLOAT
31+
32+
#ifdef LIBC_TARGET_CPU_HAS_FPU_DOUBLE
33+
template <> LIBC_INLINE double sqrt<double>(double x) {
34+
double y;
35+
asm("fsqrt %d0, %d1\n\t" : "=w"(y) : "w"(x));
36+
return y;
37+
}
38+
#endif // LIBC_TARGET_CPU_HAS_FPU_DOUBLE
39+
40+
} // namespace fputil
41+
} // namespace LIBC_NAMESPACE_DECL
42+
43+
#endif // LLVM_LIBC_SRC___SUPPORT_FPUTIL_AARCH64_SQRT_H

libc/src/__support/FPUtil/arm/sqrt.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "src/__support/macros/properties/architectures.h"
1515
#include "src/__support/macros/properties/cpu_features.h"
1616

17-
#if !defined(LIBC_TARGET_ARCH_IS_ANY_ARM)
17+
#if !defined(LIBC_TARGET_ARCH_IS_ARM)
1818
#error "Invalid include"
1919
#endif
2020

@@ -24,15 +24,15 @@ namespace fputil {
2424
#ifdef LIBC_TARGET_CPU_HAS_FPU_FLOAT
2525
template <> LIBC_INLINE float sqrt<float>(float x) {
2626
float y;
27-
asm("fsqrt %s0, %s1\n\t" : "=w"(y) : "w"(x));
27+
asm("vsqrt %0, %1\n\t" : "=w"(y) : "w"(x));
2828
return y;
2929
}
3030
#endif // LIBC_TARGET_CPU_HAS_FPU_FLOAT
3131

3232
#ifdef LIBC_TARGET_CPU_HAS_FPU_DOUBLE
3333
template <> LIBC_INLINE double sqrt<double>(double x) {
3434
double y;
35-
asm("fsqrt %d0, %d1\n\t" : "=w"(y) : "w"(x));
35+
asm("vsqrt %0, %1\n\t" : "=w"(y) : "w"(x));
3636
return y;
3737
}
3838
#endif // LIBC_TARGET_CPU_HAS_FPU_DOUBLE

libc/src/__support/FPUtil/sqrt.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ template <> LIBC_INLINE double sqrt<double>(double x) {
4242
// Use inline assembly when __builtin_elementwise_sqrt is not available.
4343
#if defined(LIBC_TARGET_CPU_HAS_SSE2)
4444
#include "x86_64/sqrt.h"
45-
#elif defined(LIBC_TARGET_ARCH_IS_ANY_ARM)
45+
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
46+
#include "aarch64/sqrt.h"
47+
#elif defined(LIBC_TARGET_ARCH_IS_ARM)
4648
#include "arm/sqrt.h"
4749
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
4850
#include "riscv/sqrt.h"

lldb/include/lldb/Core/Mangled.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ class Mangled {
246246
/// for s, otherwise the enumerator for the mangling scheme detected.
247247
static Mangled::ManglingScheme GetManglingScheme(llvm::StringRef const name);
248248

249+
static bool IsMangledName(llvm::StringRef name);
250+
249251
/// Decode a serialized version of this object from data.
250252
///
251253
/// \param data

lldb/include/lldb/Core/RichManglingContext.h

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "lldb/lldb-forward.h"
1313
#include "lldb/lldb-private.h"
1414

15+
#include "lldb/Target/Language.h"
1516
#include "lldb/Utility/ConstString.h"
1617

1718
#include "llvm/ADT/Any.h"
@@ -67,11 +68,7 @@ class RichManglingContext {
6768
char *m_ipd_buf;
6869
size_t m_ipd_buf_size = 2048;
6970

70-
/// Members for PluginCxxLanguage
71-
/// Cannot forward declare inner class CPlusPlusLanguage::MethodName. The
72-
/// respective header is in Plugins and including it from here causes cyclic
73-
/// dependency. Instead keep a llvm::Any and cast it on-access in the cpp.
74-
llvm::Any m_cxx_method_parser;
71+
std::unique_ptr<Language::MethodName> m_cxx_method_parser;
7572

7673
/// Clean up memory when using PluginCxxLanguage
7774
void ResetCxxMethodParser();
@@ -81,15 +78,6 @@ class RichManglingContext {
8178

8279
/// Uniform handling of string buffers for ItaniumPartialDemangler.
8380
llvm::StringRef processIPDStrResult(char *ipd_res, size_t res_len);
84-
85-
/// Cast the given parser to the given type. Ideally we would have a type
86-
/// trait to deduce \a ParserT from a given InfoProvider, but unfortunately we
87-
/// can't access CPlusPlusLanguage::MethodName from within the header.
88-
template <class ParserT> static ParserT *get(llvm::Any parser) {
89-
assert(parser.has_value());
90-
assert(llvm::any_cast<ParserT *>(&parser));
91-
return *llvm::any_cast<ParserT *>(&parser);
92-
}
9381
};
9482

9583
} // namespace lldb_private

lldb/include/lldb/Symbol/FuncUnwinders.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,6 @@ class FuncUnwinders {
6161
});
6262
}
6363

64-
// A function may have a Language Specific Data Area specified -- a block of
65-
// data in
66-
// the object file which is used in the processing of an exception throw /
67-
// catch. If any of the UnwindPlans have the address of the LSDA region for
68-
// this function, this will return it.
69-
Address GetLSDAAddress(Target &target);
70-
71-
// A function may have a Personality Routine associated with it -- used in the
72-
// processing of throwing an exception. If any of the UnwindPlans have the
73-
// address of the personality routine, this will return it. Read the target-
74-
// pointer at this address to get the personality function address.
75-
Address GetPersonalityRoutinePtrAddress(Target &target);
76-
7764
// The following methods to retrieve specific unwind plans should rarely be
7865
// used. Instead, clients should ask for the *behavior* they are looking for,
7966
// using one of the above UnwindPlan retrieval methods.

lldb/include/lldb/Symbol/UnwindPlan.h

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -428,34 +428,17 @@ class UnwindPlan {
428428
bool m_unspecified_registers_are_undefined = false;
429429
}; // class Row
430430

431-
typedef std::shared_ptr<Row> RowSP;
432-
433431
UnwindPlan(lldb::RegisterKind reg_kind)
434432
: m_register_kind(reg_kind), m_return_addr_register(LLDB_INVALID_REGNUM),
435433
m_plan_is_sourced_from_compiler(eLazyBoolCalculate),
436434
m_plan_is_valid_at_all_instruction_locations(eLazyBoolCalculate),
437435
m_plan_is_for_signal_trap(eLazyBoolCalculate) {}
438436

439437
// Performs a deep copy of the plan, including all the rows (expensive).
440-
UnwindPlan(const UnwindPlan &rhs)
441-
: m_plan_valid_ranges(rhs.m_plan_valid_ranges),
442-
m_register_kind(rhs.m_register_kind),
443-
m_return_addr_register(rhs.m_return_addr_register),
444-
m_source_name(rhs.m_source_name),
445-
m_plan_is_sourced_from_compiler(rhs.m_plan_is_sourced_from_compiler),
446-
m_plan_is_valid_at_all_instruction_locations(
447-
rhs.m_plan_is_valid_at_all_instruction_locations),
448-
m_plan_is_for_signal_trap(rhs.m_plan_is_for_signal_trap),
449-
m_lsda_address(rhs.m_lsda_address),
450-
m_personality_func_addr(rhs.m_personality_func_addr) {
451-
m_row_list.reserve(rhs.m_row_list.size());
452-
for (const RowSP &row_sp : rhs.m_row_list)
453-
m_row_list.emplace_back(new Row(*row_sp));
454-
}
438+
UnwindPlan(const UnwindPlan &rhs) = default;
439+
UnwindPlan &operator=(const UnwindPlan &rhs) = default;
440+
455441
UnwindPlan(UnwindPlan &&rhs) = default;
456-
UnwindPlan &operator=(const UnwindPlan &rhs) {
457-
return *this = UnwindPlan(rhs); // NB: moving from a temporary (deep) copy
458-
}
459442
UnwindPlan &operator=(UnwindPlan &&) = default;
460443

461444
~UnwindPlan() = default;
@@ -487,7 +470,7 @@ class UnwindPlan {
487470
uint32_t GetInitialCFARegister() const {
488471
if (m_row_list.empty())
489472
return LLDB_INVALID_REGNUM;
490-
return m_row_list.front()->GetCFAValue().GetRegisterNumber();
473+
return m_row_list.front().GetCFAValue().GetRegisterNumber();
491474
}
492475

493476
// This UnwindPlan may not be valid at every address of the function span.
@@ -553,24 +536,12 @@ class UnwindPlan {
553536
m_plan_is_sourced_from_compiler = eLazyBoolCalculate;
554537
m_plan_is_valid_at_all_instruction_locations = eLazyBoolCalculate;
555538
m_plan_is_for_signal_trap = eLazyBoolCalculate;
556-
m_lsda_address.Clear();
557-
m_personality_func_addr.Clear();
558539
}
559540

560541
const RegisterInfo *GetRegisterInfo(Thread *thread, uint32_t reg_num) const;
561542

562-
Address GetLSDAAddress() const { return m_lsda_address; }
563-
564-
void SetLSDAAddress(Address lsda_addr) { m_lsda_address = lsda_addr; }
565-
566-
Address GetPersonalityFunctionPtr() const { return m_personality_func_addr; }
567-
568-
void SetPersonalityFunctionPtr(Address presonality_func_ptr) {
569-
m_personality_func_addr = presonality_func_ptr;
570-
}
571-
572543
private:
573-
std::vector<RowSP> m_row_list;
544+
std::vector<Row> m_row_list;
574545
std::vector<AddressRange> m_plan_valid_ranges;
575546
lldb::RegisterKind m_register_kind; // The RegisterKind these register numbers
576547
// are in terms of - will need to be
@@ -583,13 +554,6 @@ class UnwindPlan {
583554
lldb_private::LazyBool m_plan_is_sourced_from_compiler;
584555
lldb_private::LazyBool m_plan_is_valid_at_all_instruction_locations;
585556
lldb_private::LazyBool m_plan_is_for_signal_trap;
586-
587-
Address m_lsda_address; // Where the language specific data area exists in the
588-
// module - used
589-
// in exception handling.
590-
Address m_personality_func_addr; // The address of a pointer to the
591-
// personality function - used in
592-
// exception handling.
593557
}; // class UnwindPlan
594558

595559
} // namespace lldb_private

lldb/include/lldb/Target/Language.h

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,104 @@ class Language : public PluginInterface {
214214
return std::vector<Language::MethodNameVariant>();
215215
};
216216

217+
class MethodName {
218+
public:
219+
MethodName() {}
220+
221+
MethodName(ConstString full)
222+
: m_full(full), m_basename(), m_context(), m_arguments(),
223+
m_qualifiers(), m_return_type(), m_scope_qualified(), m_parsed(false),
224+
m_parse_error(false) {}
225+
226+
virtual ~MethodName() {};
227+
228+
void Clear() {
229+
m_full.Clear();
230+
m_basename = llvm::StringRef();
231+
m_context = llvm::StringRef();
232+
m_arguments = llvm::StringRef();
233+
m_qualifiers = llvm::StringRef();
234+
m_return_type = llvm::StringRef();
235+
m_scope_qualified.clear();
236+
m_parsed = false;
237+
m_parse_error = false;
238+
}
239+
240+
bool IsValid() {
241+
if (!m_parsed)
242+
Parse();
243+
if (m_parse_error)
244+
return false;
245+
return (bool)m_full;
246+
}
247+
248+
ConstString GetFullName() const { return m_full; }
249+
250+
llvm::StringRef GetBasename() {
251+
if (!m_parsed)
252+
Parse();
253+
return m_basename;
254+
}
255+
256+
llvm::StringRef GetContext() {
257+
if (!m_parsed)
258+
Parse();
259+
return m_context;
260+
}
261+
262+
llvm::StringRef GetArguments() {
263+
if (!m_parsed)
264+
Parse();
265+
return m_arguments;
266+
}
267+
268+
llvm::StringRef GetQualifiers() {
269+
if (!m_parsed)
270+
Parse();
271+
return m_qualifiers;
272+
}
273+
274+
llvm::StringRef GetReturnType() {
275+
if (!m_parsed)
276+
Parse();
277+
return m_return_type;
278+
}
279+
280+
std::string GetScopeQualifiedName() {
281+
if (!m_parsed)
282+
Parse();
283+
return m_scope_qualified;
284+
}
285+
286+
protected:
287+
virtual void Parse() {
288+
m_parsed = true;
289+
m_parse_error = true;
290+
}
291+
292+
ConstString m_full; // Full name:
293+
// "size_t lldb::SBTarget::GetBreakpointAtIndex(unsigned
294+
// int) const"
295+
llvm::StringRef m_basename; // Basename: "GetBreakpointAtIndex"
296+
llvm::StringRef m_context; // Decl context: "lldb::SBTarget"
297+
llvm::StringRef m_arguments; // Arguments: "(unsigned int)"
298+
llvm::StringRef m_qualifiers; // Qualifiers: "const"
299+
llvm::StringRef m_return_type; // Return type: "size_t"
300+
std::string m_scope_qualified;
301+
bool m_parsed = false;
302+
bool m_parse_error = false;
303+
};
304+
305+
virtual std::unique_ptr<Language::MethodName>
306+
GetMethodName(ConstString name) const {
307+
return std::make_unique<Language::MethodName>(name);
308+
};
309+
310+
virtual std::pair<lldb::FunctionNameType, llvm::StringRef>
311+
GetFunctionNameInfo(ConstString name) const {
312+
return std::pair{lldb::eFunctionNameTypeNone, llvm::StringRef()};
313+
};
314+
217315
/// Returns true iff the given symbol name is compatible with the mangling
218316
/// scheme of this language.
219317
///

lldb/source/Core/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ if (LLDB_ENABLE_CURSES)
1616
endif()
1717
endif()
1818

19-
# TODO: Add property `NO_PLUGIN_DEPENDENCIES` to lldbCore
20-
add_lldb_library(lldbCore
19+
add_lldb_library(lldbCore NO_PLUGIN_DEPENDENCIES
2120
Address.cpp
2221
AddressRange.cpp
2322
AddressRangeListImpl.cpp
@@ -71,8 +70,6 @@ add_lldb_library(lldbCore
7170
lldbUtility
7271
lldbValueObject
7372
lldbVersion
74-
lldbPluginCPlusPlusLanguage
75-
lldbPluginObjCLanguage
7673
${LLDB_CURSES_LIBS}
7774

7875
CLANG_LIBS

0 commit comments

Comments
 (0)