[all-commits] [llvm/llvm-project] 73b229: [CUDA][HIP] Do not promote constexpr var with non-...

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Tue Feb 15 12:17:02 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73b22935a7a863679021598db6a45fcfb62cd321
      https://github.com/llvm/llvm-project/commit/73b22935a7a863679021598db6a45fcfb62cd321
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2022-02-15 (Tue, 15 Feb 2022)

  Changed paths:
    M clang/lib/Sema/SemaCUDA.cpp
    A clang/test/SemaCUDA/constexpr-var.cu

  Log Message:
  -----------
  [CUDA][HIP] Do not promote constexpr var with non-constant initializer

constexpr var may be initialized with address of non-const variable.
In this case the initializer is not constant in device compilation.
This has been handled for const vars but not for constexpr vars.

This patch makes handling of const var and constexpr var
consistent.

Reviewed by: Artem Belevich

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

Fixes: https://github.com/llvm/llvm-project/issues/53780




More information about the All-commits mailing list