[PATCH] D158280: [jitlink/rtdydl][checker] Construct disassembler at every decodeInst

Eymen Ünay via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 18 09:56:23 PDT 2023


Eymay created this revision.
Eymay added reviewers: lhames, sgraenitz.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Eymay added a comment.
Eymay edited the summary of this revision.
Eymay edited the summary of this revision.
Eymay published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch needs refactoring in areas such as error handling, backend specialization structure for triple manipulation and state management for triple change.


lhames added a comment.

What if you made `RuntimeDyldChecker::getInstPrinter` and `RuntimeDyld::getDisasssembler` take a symbol, then check the target flags in each of those methods so that the callees reduce back to, e.g.

  auto Dis = Checker.getDisassembler(Symbol); // TT and TF taken from Checker member variables.
  
  if (auto E = Dis.takeError()) {
    errs() << "Error obtaining disassembler: " << toString(std::move(E))
           << "\n";
    return false; // Return false or take appropriate action.
  }



================
Comment at: llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h:143
+    bool hasTargetFlags(TargetFlagsType Flags) const {
+      return static_cast<TargetFlagsType>(TargetFlags) & Flags;
+    }
----------------
What about a `getTargetFlags` method, and let the client do the bitwise ops?


**WIP** - Draft feature for disassembler switching in RuntimeDyldChecker
Under development but looking for early feedback

Adds support for Disassembler switching in the middle of checking the buffer. SymbolInfo is
extended with TargetFlag to provide info for RuntimeDyldChecker.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158280

Files:
  llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
  llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h
  llvm/tools/llvm-jitlink/llvm-jitlink-elf.cpp
  llvm/tools/llvm-jitlink/llvm-jitlink.cpp
  llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158280.551504.patch
Type: text/x-patch
Size: 19668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230818/115fcaff/attachment.bin>


More information about the llvm-commits mailing list