[all-commits] [llvm/llvm-project] 6df32b: [ORC] Enable DenseMap<SymbolStringPtr, T>::find_as...

lhames via All-commits all-commits at lists.llvm.org
Tue Jan 31 18:11:35 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6df32b8db1f0b2f1c91f3dbb62a0ced07c314aa9
  Author: Lang Hames <lhames at gmail.com>
  Date:   2023-01-31 (Tue, 31 Jan 2023)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
    M llvm/unittests/ExecutionEngine/Orc/SymbolStringPoolTest.cpp

  Log Message:
  [ORC] Enable DenseMap<SymbolStringPtr, T>::find_as(NonOwningSymbolStringPtr).

For maps of SymbolStringPtrs to values, enables lookup using
NonOwningSymbolStringPtr keys.

  Commit: 380355cb4c6ba28cb8b9a573591dcce694a047ee
  Author: Lang Hames <lhames at gmail.com>
  Date:   2023-01-31 (Tue, 31 Jan 2023)

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

  Log Message:
  [ORC] Fix an iterator invalidation issue in JITDylib::defineMaterializing.

The loop body may add and remove entries in the symbol table so we can't hold
iterators to the entries. This commit updates the method to use the newly added
NonOwningSymbolStringPtr type as keys for removal instead.

Side note: This bug has been present since the introduction of the
defineMaterializing method, but the method is called rarely and DenseMap
resizes are also rare so we didn't see any fallout until a large program was
thrown at it. There's no testcase as I haven't been able to reproduce the
failure with smaller testcases.

Compare: https://github.com/llvm/llvm-project/compare/25ecfbf892ae...380355cb4c6b

More information about the All-commits mailing list