[all-commits] [llvm/llvm-project] aad873: [AsmWriter] Properly handle uselistorder for globa...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Jun 28 14:15:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aad87328fabff9382bac0b452c83934515e6d0c8
      https://github.com/llvm/llvm-project/commit/aad87328fabff9382bac0b452c83934515e6d0c8
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-06-28 (Mon, 28 Jun 2021)

  Changed paths:
    M llvm/lib/IR/AsmWriter.cpp
    A llvm/test/Assembler/uselistorder_global.ll
    M llvm/test/Bitcode/use-list-order2.ll

  Log Message:
  -----------
  [AsmWriter] Properly handle uselistorder for global symbols

Currently, AsmWriter will stick uselistorder directives for global
values inside individual functions. This doesn't make a lot of sense,
and interacts badly with D104950, as use list order adjustments will
be performed while still working on a forward reference.

This patch instead always prints uselistorder directives for globals
at the module level. This isn't really compatible with the previously
used implementation approach. Rather than walking through all values
again, use the OrderMap (after stabilizing its order) to go through
all values and compute the use list shuffles for them. Classify them
per-function, or nullptr for globals.

Even independently of D104950, this seems to fix a few
verify-uselistorder failures. Conveniently, there is even a
pre-existing failing test that this fixes.

Differential Revision: https://reviews.llvm.org/D104976




More information about the All-commits mailing list