[PATCH] D157951: [NFC][TLI] Replace std::lower_bound call in getLibFunc with DenseMap lookup

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 02:04:35 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/TargetLibraryInfo.cpp:957
+    IsInitialized = true;
+  }
+
----------------
This initialization isn't thread-safe. I believe the proper pattern is `static const DenseMap<StringRef, unsigned> Indices = buildIndexMap();` or similar.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157951



More information about the llvm-commits mailing list