[all-commits] [llvm/llvm-project] 28c52e: [clang][X86] Support __attribute__((model("small"/...

Arthur Eubanks via All-commits all-commits at lists.llvm.org
Fri Feb 14 16:35:38 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 28c52edbe33e671ace58309e60598f3342e9ca73
      https://github.com/llvm/llvm-project/commit/28c52edbe33e671ace58309e60598f3342e9ca73
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2025-02-14 (Fri, 14 Feb 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/AttrDocs.td
    M clang/lib/Sema/SemaDeclAttr.cpp
    A clang/test/CodeGen/X86/codemodel.cpp
    M clang/test/Sema/attr-model.cpp

  Log Message:
  -----------
  [clang][X86] Support __attribute__((model("small"/"large"))) (#124834)

Following up #72078, on x86-64 this allows a global to be considered
small or large regardless of the code model. For example, x86-64's
medium code model by default classifies globals as small or large
depending on their size relative to -mlarge-data-threshold.

GPU compilations compile the same TU for both the host and device, but
only codegen the host or device portions of it depending on attributes.
However, we still Sema the TU, and will warn on an unknown attribute for
the device compilation since this attribute is target-specific. Since
they're intended for the host, accept but ignore this attribute for
device compilations where the host is either unknown or known to
support the attribute.

Co-authored-by: @pranavk



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