[all-commits] [llvm/llvm-project] b9d678: [Clang] Use TargetInfo when deciding if an address...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Nov 15 04:58:59 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b9d678d22f74ebd6e34f0a3501fb01d3d80984e7
      https://github.com/llvm/llvm-project/commit/b9d678d22f74ebd6e34f0a3501fb01d3d80984e7
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-11-15 (Fri, 15 Nov 2024)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/VirtualNearMissCheck.cpp
    M clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp
    M clang/include/clang/AST/CanonicalType.h
    M clang/include/clang/AST/Type.h
    M clang/include/clang/Basic/TargetInfo.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/Basic/Targets/AMDGPU.h
    M clang/lib/Basic/Targets/NVPTX.h
    M clang/lib/Sema/SemaARM.cpp
    M clang/lib/Sema/SemaCast.cpp
    M clang/lib/Sema/SemaCodeComplete.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExceptionSpec.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaFixItUtils.cpp
    M clang/lib/Sema/SemaInit.cpp
    M clang/lib/Sema/SemaObjC.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    A clang/test/CodeGen/target-addrspace.cpp
    A clang/test/Sema/amdgcn-address-spaces.c
    A clang/test/Sema/nvptx-address-spaces.c

  Log Message:
  -----------
  [Clang] Use TargetInfo when deciding if an address space is compatible  (#115777)

Summary:
Address spaces are used in several embedded and GPU targets to describe
accesses to different types of memory. Currently we use the address
space enumerations to control which address spaces are considered
supersets of eachother, however this is also a target level property as
described by the C standard's passing mentions. This patch allows the
address space checks to use the target information to decide if a
pointer conversion is legal. For AMDGPU and NVPTX, all supported address
spaces can be converted to the default address space.

More semantic checks can be added on top of this, for now I'm mainly
looking to get more standard semantics working for C/C++. Right now the
address space conversions must all be done explicitly in C/C++ unlike
the offloading languages which define their own custom address spaces
that just map to the same target specific ones anyway. The main question
is if this behavior is a function of the target or the language.



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