[all-commits] [llvm/llvm-project] 0745b0: Fix incorrect cast in VisitSYCLUniqueStableNameExpr

Alexander Richardson via All-commits all-commits at lists.llvm.org
Sat Nov 19 03:44:10 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0745b0c0354a0c8e1fefb68a3876d15db6c2e27a
      https://github.com/llvm/llvm-project/commit/0745b0c0354a0c8e1fefb68a3876d15db6c2e27a
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2022-11-19 (Sat, 19 Nov 2022)

  Changed paths:
    M clang/lib/CodeGen/CGExprScalar.cpp
    M clang/test/CodeGenSYCL/unique_stable_name.cpp
    M clang/test/CodeGenSYCL/unique_stable_name_windows_diff.cpp

  Log Message:
  -----------
  Fix incorrect cast in VisitSYCLUniqueStableNameExpr

Clang language-level address spaces and LLVM pointer address spaces are
not the same thing (even though they will both have a numeric value of
zero in many cases). LangAS is a enum class to avoid implicit conversions,
but eba69b59d1a30dead07da2c279c8ecfd2b62ba9f avoided the compiler error by
adding a `static_cast<>`. While touching this code, simplify it by using
CreatePointerBitCastOrAddrSpaceCast() which is already a no-op if the types
match.

This changes the code generation for spir64 to place the globals in
the sycl_global addreds space, which maps to `addrspace(1)`.

Reviewed By: bader

Differential Revision: https://reviews.llvm.org/D138284




More information about the All-commits mailing list