[all-commits] [llvm/llvm-project] fd3263: [test] Split some tests which test both static and...

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri Dec 4 19:09:40 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd32639823e4d74eadbca5b0a9610a87d69b25c8
      https://github.com/llvm/llvm-project/commit/fd32639823e4d74eadbca5b0a9610a87d69b25c8
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-12-04 (Fri, 04 Dec 2020)

  Changed paths:
    A llvm/test/CodeGen/AArch64/tagged-globals-pic.ll
    A llvm/test/CodeGen/AArch64/tagged-globals-static.ll
    R llvm/test/CodeGen/AArch64/tagged-globals.ll
    M llvm/test/tools/gold/X86/relocation-model-pic.ll

  Log Message:
  -----------
  [test] Split some tests which test both static and pic relocation models

TargetMachine::shouldAssumeDSOLocal currently implies dso_local for
Static. Split some tests so that these `external dso_local global`
will align with the Clang behavior.


  Commit: 961f31d8ad14c66829991522d73e14b5a96ff6d4
      https://github.com/llvm/llvm-project/commit/961f31d8ad14c66829991522d73e14b5a96ff6d4
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-12-04 (Fri, 04 Dec 2020)

  Changed paths:
    M llvm/lib/Target/TargetMachine.cpp
    M llvm/test/CodeGen/AArch64/extern-weak.ll
    M llvm/test/CodeGen/AArch64/tiny_model.ll
    M llvm/test/CodeGen/X86/abi-isel.ll
    M llvm/test/CodeGen/X86/br-fold.ll
    M llvm/test/CodeGen/X86/code-model-elf.ll
    M llvm/test/CodeGen/X86/emutls.ll
    M llvm/test/CodeGen/X86/linux-preemption.ll
    M llvm/test/CodeGen/X86/speculative-load-hardening-indirect.ll
    M llvm/test/CodeGen/X86/tail-dup-merge-loop-headers.ll
    M llvm/test/CodeGen/X86/x86-64-mem.ll
    M llvm/test/CodeGen/X86/x86-store-gv-addr.ll
    M llvm/test/CodeGen/XCore/threads.ll

  Log Message:
  -----------
  [TargetMachine] Don't imply dso_local on global variable declarations in Reloc::Static model

clang/lib/CodeGen/CodeGenModule sets dso_local on applicable global variables,
we don't need to duplicate the work in TargetMachine:shouldAssumeDSOLocal.
(Actually the long-term goal (started by r324535) is to remove as much
additional implied dso_local in TargetMachine:shouldAssumeDSOLocal as possible.)

By not implying dso_local, we will respect dso_local/dso_preemptable specifiers
set by the frontend. This allows the proposed -fno-direct-access-external-data
option to work with -fno-pic and prevent copy relocations.

This patch should be NFC in terms of the Clang behavior because the case we
don't set dso_local is a case Clang sets dso_local. However, some tests don't
set dso_local on some `external global` and expose some differences. Most tests
have been fixed to be more robust in previous commits.


Compare: https://github.com/llvm/llvm-project/compare/03fc4f2e9a66...961f31d8ad14


More information about the All-commits mailing list