[PATCH] D105135: [Internalize] Preserve variables externally initialized.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 1 09:33:47 PDT 2021


tra added inline comments.


================
Comment at: clang/test/CodeGenCUDA/host-used-device-var.cu:21-24
-__device__ int v1;
-
-// DEV-NEG-NOT: @v2
-__constant__ int v2;
----------------
These should be changed to positive checks to verify that they are emitted.
Ditto for other tests.


================
Comment at: clang/test/CodeGenCUDA/host-used-device-var.cu:20
 
-// DEV-NEG-NOT: @v1
-__device__ int v1;
----------------
hliao wrote:
> BTW, as clang codegen tests, those checks should not rely on middle-end optimizations to work correctly.
What happens if you remove -O3?
Sometimes optimization is helpful as it reduces the amount of IR we need to check and how it's structured. It's much easier to see what went wrong when you get just a handful of IR statements in the failing test output.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105135/new/

https://reviews.llvm.org/D105135



More information about the cfe-commits mailing list