[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-06-04 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 added inline comments. Comment at: clang/test/CodeGenCUDA/device-use-host-var.cu:68 +// NEG-NOT: @_ZL13var_host_only +// NEG-NOT: external tra wrote: > yaxunl wrote: > > sbc100 wrote: > > > This seems to break if the pathname where the llvm checkout

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-06-04 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/test/CodeGenCUDA/device-use-host-var.cu:68 +// NEG-NOT: @_ZL13var_host_only +// NEG-NOT: external yaxunl wrote: > sbc100 wrote: > > This seems to break if the pathname where the llvm checkout lives contains > > the

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-06-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/test/CodeGenCUDA/device-use-host-var.cu:68 +// NEG-NOT: @_ZL13var_host_only +// NEG-NOT: external sbc100 wrote: > This seems to break if the pathname where the llvm

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-06-04 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 added inline comments. Comment at: clang/test/CodeGenCUDA/device-use-host-var.cu:68 +// NEG-NOT: @_ZL13var_host_only +// NEG-NOT: external This seems to break if the pathname where the llvm checkout lives contains the word "external"

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-06-01 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG04caa7c3e02f: [CUDA][HIP] Promote const variables to constant (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-06-01 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. I'm done with testing. The patch does not seem to break anything obvious. Tensorflow builds and works. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103108/new/

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-06-01 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. LGTM. I would like to test the patch on our code first. Please wait a bit before landing the patch. I should be able to have the results tomorrow. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103108/new/ https://reviews.llvm.org/D103108

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-06-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103108/new/ https://reviews.llvm.org/D103108 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 348149. yaxunl marked an inline comment as done. yaxunl added a comment. fix test CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103108/new/ https://reviews.llvm.org/D103108 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/test/SemaCUDA/device-use-host-var.cu:90 + const int _const_var = global_const_var; const int _constexpr_var = global_constexpr_var; *out = ref_host_var; tra wrote: >

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. Overall looks good, though I've got one more question. Comment at: clang/test/SemaCUDA/device-use-host-var.cu:90 + const int _const_var = global_const_var; const int _constexpr_var = global_constexpr_var; *out = ref_host_var; What

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Sema/SemaCUDA.cpp:568 +} +// Check whether a variable has an allowed initializer for a CUDA device side +// variable with global storage. \p VD may be a host variable to be checked for tra wrote: > Nit: add an

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 348089. yaxunl marked 4 inline comments as done. yaxunl added a comment. revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103108/new/ https://reviews.llvm.org/D103108 Files:

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/lib/Sema/SemaCUDA.cpp:568 +} +// Check whether a variable has an allowed initializer for a CUDA device side +// variable with global storage. \p VD may be a host variable to be checked for Nit: add an empty line to

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 347958. yaxunl added a comment. do not promote or check dependent variables since their ctor/dtor/initializers are not determined yet CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103108/new/ https://reviews.llvm.org/D103108 Files:

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. Recently we added diagnosing ODR-use of host variables in device functions, which includes ODR-use of const host variables since they are not really emitted on device side. This caused