estewart08 added a comment. In D115661#3190477 <https://reviews.llvm.org/D115661#3190477>, @yaxunl wrote:
> This may cause perf regressions for HIP. Do you have a test that would show such a regression? Emitting a store to address space (4) in a constructor seems the wrong thing to do. ================ Comment at: clang/test/CodeGenCXX/cxx11-extern-constexpr.cpp:10 // X86: @_ZN1A3FooE ={{.*}} constant i32 123, align 4 -// AMD: @_ZN1A3FooE ={{.*}} addrspace(4) constant i32 123, align 4 +// AMD: @_ZN1A3FooE ={{.*}} addrspace(1) constant i32 123, align 4 const int *p = &A::Foo; // emit available_externally ---------------- yaxunl wrote: > Do you know why this is not treated as constant initialization? > There is no initialization here: ``` const int A::Foo; ``` It seems the compiler ignores the 123 in the struct. I see address space (4) when the test is written like this: ``` struct A { static const int Foo; }; const int A::Foo = 123; ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115661/new/ https://reviews.llvm.org/D115661 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits