[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)
@@ -683,6 +686,17 @@ def CreateHandle : DXILOp<57, createHandle> { let stages = [Stages]; } +def BufferLoad : DXILOp<68, bufferLoad> { + let Doc = "reads from a TypedBuffer"; + // Handle, Coord0, Coord1 + let arguments = [HandleTy, Int32Ty, Int32Ty]; + let result = OverloadTy; + let overloads = + [Overloads]; llvm-beanz wrote: The 16-bit overloads were always valid in DXIL 1.0, but they didn't actually mean 16-bit types, they meant the min16{float|int|uint} types. This is one of the things that's really wonky about DXIL defining interpretations of LLVM IR that conflicted with LLVM's core definition. I think the code here is accurate to what we need for that. https://github.com/llvm/llvm-project/pull/104252 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)
https://github.com/llvm-beanz approved this pull request. https://github.com/llvm/llvm-project/pull/104252 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)
llvm-beanz wrote: All looks good to me. https://github.com/llvm/llvm-project/pull/104252 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lldb] b5a631f - Revert "[LLDB] Reappply SBSaveCore AddMemoryList (#107159)"
Author: Jonas Devlieghere Date: 2024-09-07T17:08:51-07:00 New Revision: b5a631fa2c3b681cab1ea53a5ea903d56d1283e9 URL: https://github.com/llvm/llvm-project/commit/b5a631fa2c3b681cab1ea53a5ea903d56d1283e9 DIFF: https://github.com/llvm/llvm-project/commit/b5a631fa2c3b681cab1ea53a5ea903d56d1283e9.diff LOG: Revert "[LLDB] Reappply SBSaveCore AddMemoryList (#107159)" This reverts commit d4d4e77918118f1444dc5ca230d4fdf82bb05b74. Added: Modified: lldb/include/lldb/API/SBMemoryRegionInfo.h lldb/include/lldb/API/SBSaveCoreOptions.h lldb/include/lldb/Symbol/SaveCoreOptions.h lldb/include/lldb/Target/Process.h lldb/include/lldb/Utility/RangeMap.h lldb/include/lldb/lldb-enumerations.h lldb/include/lldb/lldb-forward.h lldb/include/lldb/lldb-private-interfaces.h lldb/source/API/SBSaveCoreOptions.cpp lldb/source/Commands/CommandObjectProcess.cpp lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h lldb/source/Symbol/SaveCoreOptions.cpp lldb/source/Target/CMakeLists.txt lldb/source/Target/Process.cpp lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py lldb/unittests/Process/Utility/CMakeLists.txt Removed: lldb/include/lldb/Target/CoreFileMemoryRanges.h lldb/source/Target/CoreFileMemoryRanges.cpp lldb/unittests/Process/Utility/CoreFileMemoryRangesTest.cpp diff --git a/lldb/include/lldb/API/SBMemoryRegionInfo.h b/lldb/include/lldb/API/SBMemoryRegionInfo.h index f9a5dc993d7cb6..be55de4ead1fa8 100644 --- a/lldb/include/lldb/API/SBMemoryRegionInfo.h +++ b/lldb/include/lldb/API/SBMemoryRegionInfo.h @@ -120,7 +120,7 @@ class LLDB_API SBMemoryRegionInfo { private: friend class SBProcess; friend class SBMemoryRegionInfoList; - friend class SBSaveCoreOptions; + friend class lldb_private::ScriptInterpreter; lldb_private::MemoryRegionInfo &ref(); diff --git a/lldb/include/lldb/API/SBSaveCoreOptions.h b/lldb/include/lldb/API/SBSaveCoreOptions.h index c076d3ce6f7575..ba48ba5eaea5a0 100644 --- a/lldb/include/lldb/API/SBSaveCoreOptions.h +++ b/lldb/include/lldb/API/SBSaveCoreOptions.h @@ -80,17 +80,6 @@ class LLDB_API SBSaveCoreOptions { /// \return True if the thread was removed, false if it was not in the list. bool RemoveThread(lldb::SBThread thread); - /// Add a memory region to save in the core file. - /// - /// \param region The memory region to save. - /// \returns An empty SBError upon success, or an error if the region is - /// invalid. - /// \note Ranges that overlapped will be unioned into a single region, this - /// also supercedes stack minification. Specifying full regions and a - /// non-custom core style will include the specified regions and union them - /// with all style specific regions. - SBError AddMemoryRegionToSave(const SBMemoryRegionInfo ®ion); - /// Reset all options. void Clear(); diff --git a/lldb/include/lldb/Symbol/SaveCoreOptions.h b/lldb/include/lldb/Symbol/SaveCoreOptions.h index d90d08026016dc..f4fed4676fa4ae 100644 --- a/lldb/include/lldb/Symbol/SaveCoreOptions.h +++ b/lldb/include/lldb/Symbol/SaveCoreOptions.h @@ -10,15 +10,13 @@ #define LLDB_SOURCE_PLUGINS_OBJECTFILE_SaveCoreOPTIONS_H #include "lldb/Utility/FileSpec.h" -#include "lldb/Utility/RangeMap.h" +#include "lldb/lldb-forward.h" +#include "lldb/lldb-types.h" #include -#include #include #include -using MemoryRanges = lldb_private::RangeVector; - namespace lldb_private { class SaveCoreOptions { @@ -40,12 +38,8 @@ class SaveCoreOptions { Status AddThread(lldb::ThreadSP thread_sp); bool RemoveThread(lldb::ThreadSP thread_sp); bool ShouldThreadBeSaved(lldb::tid_t tid) const; - bool HasSpecifiedThreads() const; Status EnsureValidConfiguration(lldb::ProcessSP process_sp) const; - const MemoryRanges &GetCoreFileMemoryRanges() const; - - void AddMemoryRegionToSave(const lldb_private::MemoryRegionInfo ®ion); void Clear(); @@ -57,7 +51,6 @@ class SaveCoreOptions { std::optional m_style; lldb::ProcessSP m_process_sp; std::unordered_set m_threads_to_save; - MemoryRanges m_regions_to_save; }; } // namespace lldb_private diff --git a/lldb/include/lldb/Target/CoreFileMemoryRanges.h b/lldb/include/lldb/Target/CoreFileMemoryRanges.h deleted file mode 100644 index 503ecd691e5948..00 --- a/lldb/include/lldb/Target/CoreFileMemoryRanges.h +++ /dev/null @@ -1,50 +0,0 @@ -//===-- CoreFileMemoryRanges.h --*- C++ -*-===// -// -/
[llvm-branch-commits] [llvm] release/19.x: [MIPS] Optimize sortRelocs for o32 (PR #106008)
https://github.com/alexrp updated https://github.com/llvm/llvm-project/pull/106008 From 20583f07954e2dadf2a9fceaee005a0a730c31e6 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 18 Aug 2024 11:24:44 -0700 Subject: [PATCH 1/3] [MIPS] Remove expensive LLVM_DEBUG relocation dump The input is usually ordered by offset, so inspecting the output is sufficient. The super expensive relocation dump is not conventional. --- .../Mips/MCTargetDesc/MipsELFObjectWriter.cpp | 32 ++- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp index 4d6a00c14a3575..1f047020d96c80 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp @@ -47,13 +47,6 @@ struct MipsRelocationEntry { } }; -#ifndef NDEBUG -raw_ostream &operator<<(raw_ostream &OS, const MipsRelocationEntry &RHS) { - RHS.print(OS); - return OS; -} -#endif - class MipsELFObjectWriter : public MCELFObjectTargetWriter { public: MipsELFObjectWriter(uint8_t OSABI, bool HasRelocationAddend, bool Is64); @@ -115,17 +108,11 @@ static InputIt find_best(InputIt First, InputIt Last, UnaryPredicate Predicate, for (InputIt I = First; I != Last; ++I) { unsigned Matched = Predicate(*I); if (Matched != FindBest_NoMatch) { - LLVM_DEBUG(dbgs() << std::distance(First, I) << " is a match ("; - I->print(dbgs()); dbgs() << ")\n"); - if (Best == Last || BetterThan(*I, *Best)) { -LLVM_DEBUG(dbgs() << ".. and it beats the last one\n"); + if (Best == Last || BetterThan(*I, *Best)) Best = I; - } } -if (Matched == FindBest_PerfectMatch) { - LLVM_DEBUG(dbgs() << ".. and it is unbeatable\n"); +if (Matched == FindBest_PerfectMatch) break; -} } return Best; @@ -201,15 +188,6 @@ static bool compareMatchingRelocs(const MipsRelocationEntry &Candidate, return PreviousBest.Matched && !Candidate.Matched; } -#ifndef NDEBUG -/// Print all the relocations. -template -static void dumpRelocs(const char *Prefix, const Container &Relocs) { - for (const auto &R : Relocs) -dbgs() << Prefix << R << "\n"; -} -#endif - MipsELFObjectWriter::MipsELFObjectWriter(uint8_t OSABI, bool HasRelocationAddend, bool Is64) : MCELFObjectTargetWriter(Is64, OSABI, ELF::EM_MIPS, HasRelocationAddend) {} @@ -448,8 +426,6 @@ void MipsELFObjectWriter::sortRelocs(const MCAssembler &Asm, std::list Sorted; std::list Remainder; - LLVM_DEBUG(dumpRelocs("R: ", Relocs)); - // Separate the movable relocations (AHL relocations using the high bits) from // the immobile relocations (everything else). This does not preserve high/low // matches that already existed in the input. @@ -459,8 +435,6 @@ void MipsELFObjectWriter::sortRelocs(const MCAssembler &Asm, }); for (auto &R : Remainder) { -LLVM_DEBUG(dbgs() << "Matching: " << R << "\n"); - unsigned MatchingType = getMatchingLoType(R); assert(MatchingType != ELF::R_MIPS_NONE && "Wrong list for reloc that doesn't need a match"); @@ -494,8 +468,6 @@ void MipsELFObjectWriter::sortRelocs(const MCAssembler &Asm, Sorted.insert(InsertionPoint, R)->Matched = true; } - LLVM_DEBUG(dumpRelocs("S: ", Sorted)); - assert(Relocs.size() == Sorted.size() && "Some relocs were not consumed"); // Overwrite the original vector with the sorted elements. From 99fe6d1feee427cc06e561facb80a4eda2ada583 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 18 Aug 2024 15:47:38 -0700 Subject: [PATCH 2/3] [MC] Remove ELFRelocationEntry::OriginalAddend For MIPS's o32 ABI (REL), https://reviews.llvm.org/D19718 introduced `OriginalAddend` to find the matching R_MIPS_LO16 relocation for R_MIPS_GOT16 when STT_SECTION conversion is applicable. lw $2, %lo(local1) lui $2, %got(local1) However, we could just store the original `Addend` in `ELFRelocationEntry` and remove `OriginalAddend`. Note: The relocation ordering algorithm in https://reviews.llvm.org/D19718 is inefficient (#104562), which will be addressed by another patch. --- llvm/include/llvm/MC/MCELFObjectWriter.h| 9 +++-- llvm/lib/MC/ELFObjectWriter.cpp | 17 ++--- .../Mips/MCTargetDesc/MipsELFObjectWriter.cpp | 9 - 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/llvm/include/llvm/MC/MCELFObjectWriter.h b/llvm/include/llvm/MC/MCELFObjectWriter.h index 9b74cbc3d3a520..d48840c0f89877 100644 --- a/llvm/include/llvm/MC/MCELFObjectWriter.h +++ b/llvm/include/llvm/MC/MCELFObjectWriter.h @@ -38,18 +38,15 @@ struct ELFRelocationEntry { unsigned Type; // The type of the relocation. uint64_t Addend; // The addend to use. const MCSymbolELF *OriginalSymbol; // The original value of Symbol if we change