[PATCH] D103112: Reimplement __builtin_unique_stable_name as __builtin_sycl_unique_stable_name
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 27 04:09:52 PDT 2021
aaron.ballman added inline comments.
================
Comment at: clang/include/clang/Basic/LangOptions.h:448
+
+ bool isSYCL() const { return SYCLIsDevice || SYCLIsHost; }
};
----------------
FWIW, we also have `SYCLVersion != SYCL_None` as a possible way to express this. Perhaps we should just use that anywhere we're using `SYCLIsDevice || SYCLIsHost` currently? (I don't have a strong opinion but am bringing it up in case someone else does.)
================
Comment at: clang/test/CodeGenSYCL/unique_stable_name.cpp:86-89
+ // FIXME: Ensure that j is incremented because VLAs are terrible.
+ int j = 55;
+ puts(__builtin_sycl_unique_stable_name(int[++j]));
+ // CHECK: call spir_func void @puts(i8 addrspace(4)* addrspacecast (i8* getelementptr inbounds ([[STRING_SIZE]], [[STRING_SIZE]]* @[[STRING]], i32 0, i32 0) to i8 addrspace(4)*))
----------------
@rjmccall -- any opinions or ideas on this? I think VLAs should likely behave the same as they do in `sizeof`, etc.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103112/new/
https://reviews.llvm.org/D103112
More information about the cfe-commits
mailing list