[PATCH] D49039: [BitcodeReader] Infer the correct runtime preemption for GlobalValue

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 6 16:01:39 PDT 2018


steven_wu added a comment.

> In that case, we can enable verification on checked-in bitcode files as a follow-up. How about testing this by round-tripping textual IR through llvm-as and llvm-dis? You just need a function, alias, and global var with local linkage and without dso_local set, right?

Nope. dso_local is even implicit in assembly which is a completely different from bitcode reader/writer.

  static void PrintDSOLocation(const GlobalValue &GV,
                               formatted_raw_ostream &Out) {
    // GVs with local linkage or non default visibility are implicitly dso_local,
    // so we don't print it.
    bool Implicit = GV.hasLocalLinkage() ||
                    (!GV.hasExternalWeakLinkage() && !GV.hasDefaultVisibility());
    if (GV.isDSOLocal() && !Implicit)
      Out << "dso_local ";
  }

I guess this patch is unifying the behavior, sort of.


Repository:
  rL LLVM

https://reviews.llvm.org/D49039





More information about the llvm-commits mailing list