@@ -4249,7 +4249,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4249
4249
options::OPT_fno_sycl_early_optimizations,
4250
4250
Triple.getSubArch () != llvm::Triple::SPIRSubArch_fpga))
4251
4251
CmdArgs.push_back (" -fno-sycl-early-optimizations" );
4252
- else if (IsSYCLDevice ) {
4252
+ else if (RawTriple. isSPIR () ) {
4253
4253
// Set `sycl-opt` option to configure LLVM passes for SPIR target
4254
4254
CmdArgs.push_back (" -mllvm" );
4255
4255
CmdArgs.push_back (" -sycl-opt" );
@@ -6184,7 +6184,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
6184
6184
// selected. For optimization levels that want vectorization we use the alias
6185
6185
// option to simplify the hasFlag logic.
6186
6186
bool EnableVec = shouldEnableVectorizerAtOLevel (Args, false );
6187
- if (UseSYCLTriple && EnableSYCLEarlyOptimizations)
6187
+ if (UseSYCLTriple && RawTriple. isSPIR () && EnableSYCLEarlyOptimizations)
6188
6188
EnableVec = false ; // But disable vectorization for SYCL device code
6189
6189
OptSpecifier VectorizeAliasOption =
6190
6190
EnableVec ? options::OPT_O_Group : options::OPT_fvectorize;
@@ -6194,7 +6194,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
6194
6194
6195
6195
// -fslp-vectorize is enabled based on the optimization level selected.
6196
6196
bool EnableSLPVec = shouldEnableVectorizerAtOLevel (Args, true );
6197
- if (UseSYCLTriple && EnableSYCLEarlyOptimizations)
6197
+ if (UseSYCLTriple && RawTriple. isSPIR () && EnableSYCLEarlyOptimizations)
6198
6198
EnableSLPVec = false ; // But disable vectorization for SYCL device code
6199
6199
OptSpecifier SLPVectAliasOption =
6200
6200
EnableSLPVec ? options::OPT_O_Group : options::OPT_fslp_vectorize;
0 commit comments