[PATCH] D80186: [Inliner] Update !associated metadata during inlining

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 21 15:12:08 PDT 2020


phosek added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/InlineFunction.cpp:1148
+
+  for (GlobalVariable &GV : M->globals()) {
+    MDNode *MD = GV.getMetadata(LLVMContext::MD_associated);
----------------
eugenis wrote:
> This is technically N^2 if you do this for every function. I guess it's fine as long as you don't see a bump in the compilation time.
I don't know if the N^2 behavior is avoidable given the structure of the data where the `!associated` metadata is attached to `GlobalValue`s and AFAIK there's not way to enumerate all values use a particular `MDNode`. I've at least added extra check to ensure that we only hit this if the value has metadata attached.


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

https://reviews.llvm.org/D80186





More information about the llvm-commits mailing list