[all-commits] [llvm/llvm-project] ddebce: [X86] Respect code_model when determining if a glo...

Arthur Eubanks via All-commits all-commits at lists.llvm.org
Tue Dec 5 10:38:16 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ddebce70210dcc97646578705dd13c6fb0e3ee0e
      https://github.com/llvm/llvm-project/commit/ddebce70210dcc97646578705dd13c6fb0e3ee0e
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2023-12-05 (Tue, 05 Dec 2023)

  Changed paths:
    M llvm/lib/Target/TargetMachine.cpp
    M llvm/test/CodeGen/X86/code-model-elf-sections.ll

  Log Message:
  -----------
  [X86] Respect code_model when determining if a global is small/large (#74498)

Using the GlobalVariable code_model property added in #72077.

code_model = "small" means the global should be treated as small
regardless of the TargetMachine code model.
code_model = "large" means the global should be treated as large
regardless of the TargetMachine code model.

Inferring small/large based on a known section name still takes
precedence for correctness.

The intention is to use this for globals that are accessed very
infrequently but also take up a lot of space in the binary to mitigate
relocation overflows. Prime examples are globals that go in
"__llvm_prf_names" for coverage/PGO instrumented builds and
"asan_globals" for ASan builds.




More information about the All-commits mailing list