Skip to content

Commit f27bb01

Browse files
authored
[SYCL] Turn on -fsycl-id-queries-fit-in-int by default (#3427)
Signed-off-by: Soumi Manna <[email protected]>
1 parent 54ede40 commit f27bb01

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

clang/include/clang/Basic/LangOptions.def

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ LANGOPT(DeclareSPIRVBuiltins, 1, 0, "Declare SPIR-V builtin functions")
259259
LANGOPT(SYCLExplicitSIMD , 1, 0, "SYCL compilation with explicit SIMD extension")
260260
LANGOPT(EnableDAEInSpirKernels , 1, 0, "Enable Dead Argument Elimination in SPIR kernels")
261261
LANGOPT(
262-
SYCLValueFitInMaxInt, 1, 0,
262+
SYCLValueFitInMaxInt, 1, 1,
263263
"SYCL compiler assumes value fits within MAX_INT for member function of "
264264
"get/operator[], get_id/operator[] and get_global_id/get_global_linear_id "
265265
"in SYCL class id, iterm and nd_iterm")

clang/include/clang/Driver/Options.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,7 @@ def fsycl_instrument_device_code : Flag<["-"], "fsycl-instrument-device-code">,
24932493
HelpText<"Add ITT instrumentation intrinsics calls">,
24942494
MarshallingInfoFlag<CodeGenOpts<"SPIRITTAnnotations">>;
24952495
defm sycl_id_queries_fit_in_int: BoolFOption<"sycl-id-queries-fit-in-int",
2496-
LangOpts<"SYCLValueFitInMaxInt">, DefaultFalse,
2496+
LangOpts<"SYCLValueFitInMaxInt">, DefaultTrue,
24972497
PosFlag<SetTrue, [], "Assume">, NegFlag<SetFalse, [], "Do not assume">,
24982498
BothFlags<[CC1Option, CoreOption], " that SYCL ID queries fit within MAX_INT.">>;
24992499
def fsycl_use_bitcode : Flag<["-"], "fsycl-use-bitcode">,

clang/test/Preprocessor/sycl-macro.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clang_cc1 %s -E -dM | FileCheck %s
2+
// RUN: %clang_cc1 %s -fsycl-is-device -E -dM | FileCheck --check-prefix=CHECK-SYCL-ID %s
23
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-host -sycl-std=2017 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD %s
34
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -sycl-std=2017 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD %s
45
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -sycl-std=2020 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD-2020 %s
@@ -26,3 +27,4 @@
2627
// CHECK-MSVC: #define __SYCL_ID_QUERIES_FIT_IN_INT__ 1
2728

2829
// CHECK-NO-SYCL_FIT_IN_INT-NOT:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1
30+
// CHECK-SYCL-ID:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1

0 commit comments

Comments
 (0)