[all-commits] [llvm/llvm-project] d1327f: [clang][amdgpu] - Choose when to promote VarDecl t...
estewart08 via All-commits
all-commits at lists.llvm.org
Mon Dec 13 14:30:45 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d1327f8a574a0936f462387778adf0dfc14358f6
https://github.com/llvm/llvm-project/commit/d1327f8a574a0936f462387778adf0dfc14358f6
Author: Ethan Stewart <ethan.stewart at amd.com>
Date: 2021-12-13 (Mon, 13 Dec 2021)
Changed paths:
M clang/lib/CodeGen/TargetInfo.cpp
M clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
M clang/test/CodeGenCXX/cxx11-extern-constexpr.cpp
Log Message:
-----------
[clang][amdgpu] - Choose when to promote VarDecl to address space 4.
There are instances where clang codegen creates stores to
address space 4 in ctors, which causes a crash in llc.
This store was being optimized out at opt levels > 0.
For example:
pragma omp declare target
static const double log_smallx = log2(smallx);
pragma omp end declare target
This patch ensures that any global const that does not
have constant initialization stays in address space 1.
Note - a second patch is in the works where all global
constants are placed in address space 1 during
codegen and then the opt pass InferAdressSpaces
will promote to address space 4 where necessary.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D115661
More information about the All-commits
mailing list