Skip to content

Commit 9581922

Browse files
Fznamznonmdtoguchi
authored andcommitted
Fix sycl-post-link options
1 parent ee81855 commit 9581922

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3514,6 +3514,9 @@ class OffloadingActionBuilder final {
35143514
/// Flag to signal if the user requested device code split.
35153515
bool DeviceCodeSplit = false;
35163516

3517+
/// Flag to signal if DAE optimization is turned on.
3518+
bool EnableDAE = false;
3519+
35173520
/// The SYCL actions for the current input.
35183521
ActionList SYCLDeviceActions;
35193522

@@ -3951,7 +3954,7 @@ class OffloadingActionBuilder final {
39513954
ActionList WrapperInputs;
39523955
// post link is not optional - even if not splitting, always need to
39533956
// process specialization constants
3954-
bool MultiFileActionDeps = !isSpirvAOT || DeviceCodeSplit;
3957+
bool MultiFileActionDeps = !isSpirvAOT || DeviceCodeSplit || EnableDAE;
39553958
types::ID PostLinkOutType = isNVPTX || !MultiFileActionDeps
39563959
? types::TY_LLVM_BC
39573960
: types::TY_Tempfiletable;
@@ -4108,6 +4111,9 @@ class OffloadingActionBuilder final {
41084111
WrapDeviceOnlyBinary = Args.hasArg(options::OPT_fsycl_link_EQ);
41094112
auto *DeviceCodeSplitArg =
41104113
Args.getLastArg(options::OPT_fsycl_device_code_split_EQ);
4114+
EnableDAE =
4115+
Args.hasFlag(options::OPT_fsycl_early_optimizations,
4116+
options::OPT_fno_sycl_early_optimizations, true);
41114117
// -fsycl-device-code-split is an alias to
41124118
// -fsycl-device-code-split=per_source
41134119
DeviceCodeSplit = DeviceCodeSplitArg &&

0 commit comments

Comments
 (0)