[all-commits] [llvm/llvm-project] f3ac55: [LTO] Reset DiscardValueNames in optimize(). (#78705)

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Apr 30 04:32:51 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f3ac55fab8c30e71987120f76da70b5b6e9075f7
      https://github.com/llvm/llvm-project/commit/f3ac55fab8c30e71987120f76da70b5b6e9075f7
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2024-04-30 (Tue, 30 Apr 2024)

  Changed paths:
    M llvm/lib/LTO/LTOCodeGenerator.cpp
    M llvm/test/tools/lto/discard-value-names.ll

  Log Message:
  -----------
  [LTO] Reset DiscardValueNames in optimize(). (#78705)

libLTO parses options late, so at the moment the option is ignored. To
fix that, re-set it in optimize(), as at this point the options have been
parsed. When LTOCodeGenerator's constructor executes, the options
haven't been parsed by the linker to libLTO yet.

Note that we keep the value name of `%add = add..` because when the
module is imported, DiscardValueNames is still set to false (the default
when building with assertions).

I tried to improve this in libLTO, but I am not sure if there's a
suitable callback when all options have been set.

PR: https://github.com/llvm/llvm-project/pull/78705



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list