[all-commits] [llvm/llvm-project] 96b1f8: [ORC] Remove redundant locking of session mutex, u...

Lang Hames via All-commits all-commits at lists.llvm.org
Tue Jun 25 20:01:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 96b1f8859df3c82b6362b1dd07ee485f48cb1816
      https://github.com/llvm/llvm-project/commit/96b1f8859df3c82b6362b1dd07ee485f48cb1816
  Author: Lang Hames <lhames at gmail.com>
  Date:   2024-06-26 (Wed, 26 Jun 2024)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/Core.h
    M llvm/lib/ExecutionEngine/Orc/Core.cpp

  Log Message:
  -----------
  [ORC] Remove redundant locking of session mutex, update method name.

JITDylib::removeTracker already runs with the session mutex locked (and must do
so), so remove the redundant locking and add an 'IL_' ("inside lock") prefix to
the method name.


  Commit: 896dd322afcc1cf5dc4fa7375dedd55b59001eb4
      https://github.com/llvm/llvm-project/commit/896dd322afcc1cf5dc4fa7375dedd55b59001eb4
  Author: Lang Hames <lhames at gmail.com>
  Date:   2024-06-26 (Wed, 26 Jun 2024)

  Changed paths:
    M llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp

  Log Message:
  -----------
  [ORC] Fix block dependence calculation in ObjectLinkingLayer.

This fixes a bug in ObjectLinkingLayer::computeBlockNonLocalDeps: The worklist
needs to be built *after* all immediate dependencies / dependants are recorded,
rather than trying to populate it as part of the same loop. (Trying to do the
latter causes us to miss some blocks that should have been included in the
worklist).

This fixes a bug discovered by @Sahil123 on discord during work on
out-of-process execution support in the clang-repl.

No testcase yet. This *might* be testable with a unit test and a custom
JITLinkContext but I believe some aspects of the algorithm depend on memory
layout. I'll need to investigate that. Alternatively we could add llvm-jitlink
testcases that exercise concurrent linking (and should probably do that anyway).
Either option will require some investment and I don't want to hold this fix up
in the mean time.


Compare: https://github.com/llvm/llvm-project/compare/0fe82ea2ea7c...896dd322afcc

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list