Skip to content

Commit

Permalink
Merged master:6af81ea1d6d3 into amd-gfx:3a41fc55fff6
Browse files Browse the repository at this point in the history
Local branch amd-gfx 3a41fc5 Merged master:7a18bdb350e4 into amd-gfx:3cb71f1d313b
Remote branch master 6af81ea [mlir][std] Fold load(tensor_to_memref) into extract_element
  • Loading branch information
Sw authored and Sw committed Nov 20, 2020
2 parents 3a41fc5 + 6af81ea commit b0c49b5
Show file tree
Hide file tree
Showing 83 changed files with 3,142 additions and 855 deletions.
4 changes: 4 additions & 0 deletions clang-tools-extra/clangd/DumpAST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class DumpVisitor : public RecursiveASTVisitor<DumpVisitor> {
TEMPLATE_ARGUMENT_KIND(TemplateExpansion);
#undef TEMPLATE_ARGUMENT_KIND
}
llvm_unreachable("Unhandled ArgKind enum");
}
std::string getKind(const NestedNameSpecifierLoc &NNSL) {
assert(NNSL.getNestedNameSpecifier());
Expand All @@ -161,6 +162,7 @@ class DumpVisitor : public RecursiveASTVisitor<DumpVisitor> {
NNS_KIND(NamespaceAlias);
#undef NNS_KIND
}
llvm_unreachable("Unhandled SpecifierKind enum");
}
std::string getKind(const CXXCtorInitializer *CCI) {
if (CCI->isBaseInitializer())
Expand All @@ -185,6 +187,7 @@ class DumpVisitor : public RecursiveASTVisitor<DumpVisitor> {
TEMPLATE_KIND(SubstTemplateTemplateParmPack);
#undef TEMPLATE_KIND
}
llvm_unreachable("Unhandled NameKind enum");
}
std::string getKind(const Attr *A) {
switch (A->getKind()) {
Expand All @@ -194,6 +197,7 @@ class DumpVisitor : public RecursiveASTVisitor<DumpVisitor> {
#include "clang/Basic/AttrList.inc"
#undef ATTR
}
llvm_unreachable("Unhandled attr::Kind enum");
}
std::string getKind(const CXXBaseSpecifier &CBS) {
// There aren't really any variants of CXXBaseSpecifier.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@

using namespace __sanitizer;

#if SANITIZER_SOLARIS && defined(__sparcv9)
// FIXME: These tests probably fail because Solaris/sparcv9 uses the full
// 64-bit address space. Needs more investigation
#define SKIP_ON_SOLARIS_SPARCV9(x) DISABLED_##x
#else
#define SKIP_ON_SOLARIS_SPARCV9(x) x
#endif

// Too slow for debug build
#if !SANITIZER_DEBUG

Expand Down Expand Up @@ -701,7 +709,7 @@ TEST(SanitizerCommon, CombinedAllocator64VeryCompact) {
}
#endif

TEST(SanitizerCommon, CombinedAllocator32Compact) {
TEST(SanitizerCommon, SKIP_ON_SOLARIS_SPARCV9(CombinedAllocator32Compact)) {
TestCombinedAllocator<Allocator32Compact>();
}

Expand Down Expand Up @@ -937,7 +945,7 @@ TEST(SanitizerCommon, SizeClassAllocator64DynamicIteration) {
#endif
#endif

TEST(SanitizerCommon, SizeClassAllocator32Iteration) {
TEST(SanitizerCommon, SKIP_ON_SOLARIS_SPARCV9(SizeClassAllocator32Iteration)) {
TestSizeClassAllocatorIteration<Allocator32Compact>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,18 @@ void FastUnwindTest::TearDown() {

#if SANITIZER_CAN_FAST_UNWIND

#ifdef __sparc__
// Fake stacks don't meet SPARC UnwindFast requirements.
#define SKIP_ON_SPARC(x) DISABLED_##x
#else
#define SKIP_ON_SPARC(x) x
#endif

void FastUnwindTest::UnwindFast() {
trace.UnwindFast(start_pc, fake_bp, fake_top, fake_bottom, kStackTraceMax);
}

TEST_F(FastUnwindTest, Basic) {
TEST_F(FastUnwindTest, SKIP_ON_SPARC(Basic)) {
UnwindFast();
// Should get all on-stack retaddrs and start_pc.
EXPECT_EQ(6U, trace.size);
Expand All @@ -85,7 +92,7 @@ TEST_F(FastUnwindTest, Basic) {
}

// From: https://github.com/google/sanitizers/issues/162
TEST_F(FastUnwindTest, FramePointerLoop) {
TEST_F(FastUnwindTest, SKIP_ON_SPARC(FramePointerLoop)) {
// Make one fp point to itself.
fake_stack[4] = (uhwptr)&fake_stack[4];
UnwindFast();
Expand All @@ -97,7 +104,7 @@ TEST_F(FastUnwindTest, FramePointerLoop) {
}
}

TEST_F(FastUnwindTest, MisalignedFramePointer) {
TEST_F(FastUnwindTest, SKIP_ON_SPARC(MisalignedFramePointer)) {
// Make one fp misaligned.
fake_stack[4] += 3;
UnwindFast();
Expand All @@ -122,7 +129,7 @@ TEST_F(FastUnwindTest, ZeroFramesStackTrace) {
EXPECT_EQ(0U, trace.top_frame_bp);
}

TEST_F(FastUnwindTest, FPBelowPrevFP) {
TEST_F(FastUnwindTest, SKIP_ON_SPARC(FPBelowPrevFP)) {
// The next FP points to unreadable memory inside the stack limits, but below
// current FP.
fake_stack[0] = (uhwptr)&fake_stack[-50];
Expand All @@ -133,7 +140,7 @@ TEST_F(FastUnwindTest, FPBelowPrevFP) {
EXPECT_EQ(PC(1), trace.trace[1]);
}

TEST_F(FastUnwindTest, CloseToZeroFrame) {
TEST_F(FastUnwindTest, SKIP_ON_SPARC(CloseToZeroFrame)) {
// Make one pc a NULL pointer.
fake_stack[5] = 0x0;
UnwindFast();
Expand Down
5 changes: 5 additions & 0 deletions lldb/docs/lldb-gdb-remote.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,11 @@ tuples to return are:
// the file while for anonymous regions it have to be the name
// associated to the region if that is available.

flags:<flags-string>; // where <flags-string> is a space separated string
// of flag names. Currently the only supported flag
// is "mt" for AArch64 memory tagging. lldb will
// ignore any other flags in this field.

error:<ascii-byte-error-string>; // where <ascii-byte-error-string> is
// a hex encoded string value that
// contains an error string
Expand Down
3 changes: 3 additions & 0 deletions lldb/docs/use/qemu-testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ run-qemu.sh has following dependencies:

* --sve option will enable AArch64 SVE mode.

* --mte option will enable AArch64 MTE (memory tagging) mode.
(can be used on its own or in addition to --sve)


**Example:** Run QEMU Arm or AArch64 system emulation using run-qemu.sh
::
Expand Down
17 changes: 12 additions & 5 deletions lldb/include/lldb/Target/MemoryRegionInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ class MemoryRegionInfo {
MemoryRegionInfo() = default;
MemoryRegionInfo(RangeType range, OptionalBool read, OptionalBool write,
OptionalBool execute, OptionalBool mapped, ConstString name,
OptionalBool flash, lldb::offset_t blocksize)
OptionalBool flash, lldb::offset_t blocksize,
OptionalBool memory_tagged)
: m_range(range), m_read(read), m_write(write), m_execute(execute),
m_mapped(mapped), m_name(name), m_flash(flash), m_blocksize(blocksize) {
}
m_mapped(mapped), m_name(name), m_flash(flash), m_blocksize(blocksize),
m_memory_tagged(memory_tagged) {}

RangeType &GetRange() { return m_range; }

void Clear() {
m_range.Clear();
m_read = m_write = m_execute = eDontKnow;
m_read = m_write = m_execute = m_memory_tagged = eDontKnow;
}

const RangeType &GetRange() const { return m_range; }
Expand All @@ -48,6 +49,8 @@ class MemoryRegionInfo {

ConstString GetName() const { return m_name; }

OptionalBool GetMemoryTagged() const { return m_memory_tagged; }

void SetReadable(OptionalBool val) { m_read = val; }

void SetWritable(OptionalBool val) { m_write = val; }
Expand All @@ -66,6 +69,8 @@ class MemoryRegionInfo {

void SetBlocksize(lldb::offset_t blocksize) { m_blocksize = blocksize; }

void SetMemoryTagged(OptionalBool val) { m_memory_tagged = val; }

// Get permissions as a uint32_t that is a mask of one or more bits from the
// lldb::Permissions
uint32_t GetLLDBPermissions() const {
Expand All @@ -91,7 +96,8 @@ class MemoryRegionInfo {
return m_range == rhs.m_range && m_read == rhs.m_read &&
m_write == rhs.m_write && m_execute == rhs.m_execute &&
m_mapped == rhs.m_mapped && m_name == rhs.m_name &&
m_flash == rhs.m_flash && m_blocksize == rhs.m_blocksize;
m_flash == rhs.m_flash && m_blocksize == rhs.m_blocksize &&
m_memory_tagged == rhs.m_memory_tagged;
}

bool operator!=(const MemoryRegionInfo &rhs) const { return !(*this == rhs); }
Expand All @@ -105,6 +111,7 @@ class MemoryRegionInfo {
ConstString m_name;
OptionalBool m_flash = eDontKnow;
lldb::offset_t m_blocksize = 0;
OptionalBool m_memory_tagged = eDontKnow;
};

inline bool operator<(const MemoryRegionInfo &lhs,
Expand Down
24 changes: 24 additions & 0 deletions lldb/packages/Python/lldbsuite/test/lldbtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,30 @@ def isAArch64SVE(self):

return " sve " in cpuinfo

def hasLinuxVmFlags(self):
""" Check that the target machine has "VmFlags" lines in
its /proc/{pid}/smaps files."""

triple = self.dbg.GetSelectedPlatform().GetTriple()
if not re.match(".*-.*-linux", triple):
return False

self.runCmd('platform process list')
pid = None
for line in self.res.GetOutput().splitlines():
if 'lldb-server' in line:
pid = line.split(' ')[0]
break

if pid is None:
return False

smaps_path = self.getBuildArtifact('smaps')
self.runCmd('platform get-file "/proc/{}/smaps" {}'.format(pid, smaps_path))

with open(smaps_path, 'r') as f:
return "VmFlags" in f.read()

def getArchitecture(self):
"""Returns the architecture in effect the test suite is running with."""
module = builder_module()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,13 +727,13 @@ def parse_memory_region_packet(self, context):

# Validate keys are known.
for (key, val) in list(mem_region_dict.items()):
self.assertTrue(
key in [
"start",
"size",
"permissions",
"name",
"error"])
self.assertIn(key,
["start",
"size",
"permissions",
"flags",
"name",
"error"])
self.assertIsNotNone(val)

mem_region_dict["name"] = seven.unhexlify(mem_region_dict.get("name", ""))
Expand Down
10 changes: 9 additions & 1 deletion lldb/scripts/lldb-test-qemu/run-qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ print_usage() {
echo -e "Starts QEMU system mode emulation for the architecture.\n"
echo -e " --help\t\t\tDisplay this information."
echo -e " --arch {arm|arm64}\t\tSelects architecture QEMU system emulation."
echo -e " --sve {path}\t\t\tEnables AArch64 SVE mode.\n"
echo -e " --sve\t\t\t\tEnables AArch64 SVE mode."
echo -e " --mte\t\t\t\tEnables AArch64 MTE mode.\n"
echo -e " --rootfs {path}\t\tPath of root file system image."
echo -e " --qemu {path}\t\t\tPath of pre-installed qemu-system-* executable."
echo -e " --kernel {path}\t\tPath of Linux kernel prebuilt image.\n"
Expand Down Expand Up @@ -48,6 +49,7 @@ while [[ $# -gt 0 ]]; do
--kernel) KERNEL_IMG=$2; shift;;
--qemu) QEMU_BIN=$2; shift;;
--sve) SVE=1;;
--mte) MTE=1;;
--help) print_usage 0 ;;
*) invalid_arg "$1" ;;
esac
Expand Down Expand Up @@ -99,6 +101,9 @@ if [[ "$ARCH" == "arm" ]]; then
if [[ $SVE ]]; then
echo "warning: --sve is supported by AArch64 targets only"
fi
if [[ $MTE ]]; then
echo "warning: --mte is supported by AArch64 targets only"
fi
elif [[ "$ARCH" == "arm64" ]]; then
QEMU_MACHINE=virt
QEMU_SVE_MAX_VQ=4
Expand All @@ -107,6 +112,9 @@ elif [[ "$ARCH" == "arm64" ]]; then
if [[ $SVE ]]; then
QEMU_CPU="max,sve-max-vq=$QEMU_SVE_MAX_VQ"
fi
if [[ $MTE ]]; then
QEMU_MACHINE="$QEMU_MACHINE,mte=on"
fi
fi

run_qemu
8 changes: 7 additions & 1 deletion lldb/source/Commands/CommandObjectMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1709,12 +1709,18 @@ class CommandObjectMemoryRegion : public CommandObjectParsed {
section_name = section_sp->GetName();
}
}

result.AppendMessageWithFormatv(
"[{0:x16}-{1:x16}) {2:r}{3:w}{4:x}{5}{6}{7}{8}\n",
"[{0:x16}-{1:x16}) {2:r}{3:w}{4:x}{5}{6}{7}{8}",
range_info.GetRange().GetRangeBase(),
range_info.GetRange().GetRangeEnd(), range_info.GetReadable(),
range_info.GetWritable(), range_info.GetExecutable(), name ? " " : "",
name, section_name ? " " : "", section_name);
MemoryRegionInfo::OptionalBool memory_tagged =
range_info.GetMemoryTagged();
if (memory_tagged == MemoryRegionInfo::OptionalBool::eYes)
result.AppendMessage("memory tagging: enabled");

m_prev_end_addr = range_info.GetRange().GetRangeEnd();
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
Expand Down
Loading

0 comments on commit b0c49b5

Please sign in to comment.