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

Eymen Ünay via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 23:46:34 PDT 2023


Eymay added inline comments.


================
Comment at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp:299
+        return std::make_pair(EvalResult(ErrMsgStream.str()), "");
+      }
+      Inst.dump_pretty(ErrMsgStream, InstPrinter.get().get());
----------------
lhames wrote:
> Eymay wrote:
> > Is there a way we could try alternative triples when there is a fail? The reason is if somehow TargetFlag emission has a problem, the triple is wrong and MCDisassembler fails terribly. How should the error be handled in RuntimeDyld setting?
> What would cause `TargetFlag` emission to be incorrect? Are you worried that we're missing cases in RuntimeDyld?
> 
> If we can fix those cases without too much trouble we should. If it's too tricky to fix RuntimeDyld I'd be ok with adding some special-case logic to the checker specifically for arm / thumb: if arm fails try thumb and vice-versa. We should add a fixme to remove this as soon as RuntimeDyld is gone. It might also be good to put the hack behind a mode flag that we set when the checker is created. If we're in "RuntimeDyldMode" then we try the triple swap, if we're in JITLink we don't. This would prevent us from silently masking errors in JITLink.
I've fixed the issue with RuntimeDyld, MachO emits TargetFlag correctly and I added a fix for COFF. The issue is rather about more informative error messages. I suggest in case of failure the instPrinter can try alternative TargetFlag and give diagnostic about the decoded instruction together with an error message of TargetFlag setting. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158280



More information about the llvm-commits mailing list