Skip to content

Commit e62f3ba

Browse files
authored
[SYCL][Driver] Fix per-device ocloc argument (#12439)
We shouldn't add `-options` as per the IGC team. Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 91bddb9 commit e62f3ba

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ void SYCLToolChain::AddImpliedTargetArgs(const llvm::Triple &Triple,
13151315
// For AOT, Use ocloc's per-device options flag with the correct ocloc
13161316
// option to honor the user's specification.
13171317
PerDeviceArgs.push_back(
1318-
{DeviceName, Args.MakeArgString("-options " + BackendOptName)});
1318+
{DeviceName, Args.MakeArgString(BackendOptName)});
13191319
} else if (Triple.isSPIR() &&
13201320
Triple.getSubArch() == llvm::Triple::NoSubArch) {
13211321
// For JIT, pass -ftarget-register-alloc-mode=Device:BackendOpt to
@@ -1334,8 +1334,7 @@ void SYCLToolChain::AddImpliedTargetArgs(const llvm::Triple &Triple,
13341334
StringRef DeviceName = "pvc";
13351335
StringRef BackendOptName = SYCL::gen::getGenGRFFlag("auto");
13361336
if (IsGen)
1337-
PerDeviceArgs.push_back(
1338-
{DeviceName, Args.MakeArgString("-options " + BackendOptName)});
1337+
PerDeviceArgs.push_back({DeviceName, Args.MakeArgString(BackendOptName)});
13391338
else if (Triple.isSPIR() &&
13401339
Triple.getSubArch() == llvm::Triple::NoSubArch) {
13411340
BeArgs.push_back(Args.MakeArgString(RegAllocModeOptName + DeviceName +

clang/test/Driver/sycl-ftarget-register-alloc-mode.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,27 @@
6262
// AUTO_AOT: ocloc{{.*}} "-output"
6363
// AUTO_AOT: -device_options
6464
// AUTO_AOT: pvc
65-
// AUTO_AOT: "-options -ze-intel-enable-auto-large-GRF-mode"
65+
// AUTO_AOT: "-ze-intel-enable-auto-large-GRF-mode"
6666

6767
// LARGE_AOT: ocloc{{.*}} "-output"
6868
// LARGE_AOT: -device_options
6969
// LARGE_AOT: pvc
70-
// LARGE_AOT: "-options -ze-opt-large-register-file"
70+
// LARGE_AOT: "-ze-opt-large-register-file"
7171

7272
// SMALL_AOT: ocloc{{.*}} "-output"
7373
// SMALL_AOT: -device_options
7474
// SMALL_AOT: pvc
75-
// SMALL_AOT: "-options -ze-intel-128-GRF-per-thread"
75+
// SMALL_AOT: "-ze-intel-128-GRF-per-thread"
7676

7777
// DEFAULT_AOT-NOT: -device_options
7878

7979
// MULTIPLE_ARGS_AOT: ocloc{{.*}} "-output"
8080
// MULTIPLE_ARGS_AOT: -device_options
8181
// MULTIPLE_ARGS_AOT: pvc
82-
// MULTIPLE_ARGS_AOT: "-options -ze-intel-128-GRF-per-thread"
82+
// MULTIPLE_ARGS_AOT: "-ze-intel-128-GRF-per-thread"
8383
// MULTIPLE_ARGS_AOT: -device_options
8484
// MULTIPLE_ARGS_AOT: pvc
85-
// MULTIPLE_ARGS_AOT: "-options -ze-opt-large-register-file"
85+
// MULTIPLE_ARGS_AOT: "-ze-opt-large-register-file"
8686

8787
// AUTO_JIT: clang-offload-wrapper{{.*}} "-compile-opts=-ftarget-register-alloc-mode=pvc:-ze-intel-enable-auto-large-GRF-mode"
8888

0 commit comments

Comments
 (0)