-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Option to disable alloca address space for sret arguments #17976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
dbe18de
53d4d29
5e569a7
9d98cde
3c3ad27
4dee04d
408135b
c790e52
78901db
ee42c37
ad66fb3
54f722a
04b377d
0c4b489
6760adb
8edcba2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8827,6 +8827,11 @@ def fsycl_is_native_cpu : Flag<["-"], "fsycl-is-native-cpu">, | |
HelpText<"Perform device compilation for Native CPU.">, | ||
Visibility<[CC1Option]>, | ||
MarshallingInfoFlag<LangOpts<"SYCLIsNativeCPU">>; | ||
defm offload_use_alloca_addrspace_for_srets : BoolFOption<"offload-use-alloca-addrspace-for-srets", | ||
CodeGenOpts<"UseAllocaASForSrets">, | ||
DefaultTrue, | ||
PosFlag<SetTrue, [], [CC1Option], "Use alloca address space for sret arguments for offloading targets">, | ||
NegFlag<SetFalse>>; | ||
Comment on lines
+8832
to
+8836
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, will do. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Looks good. |
||
|
||
} // let Visibility = [CC1Option] | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5811,6 +5811,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, | |
|
||
CmdArgs.push_back("-fsycl-optimize-non-user-code"); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Extra inadvertent white space |
||
// Disable this option for SYCL by default. | ||
// TODO: This needs to be re-enabled once we have a real fix. | ||
CmdArgs.push_back("-fno-offload-use-alloca-addrspace-for-srets"); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think test impact to This option is only being added by default for SYCL (and only for device-side compilation). Is it not needed for OpenMP as well? I have vague recollections of OpenMP also being affected, though I could easily be misremembering that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The intent is to add the option for OpenMP in the product compiler not in syclos. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, right, of course, the OpenMP impact isn't relevant for intel/llvm. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @premanandrao, as stated by Tom, adding to above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I missed that part in Tom's review. I moved it to just after There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another option would be to enable the option for SPIR target. IIRC we need that for OpenMP and OpenCL in downstream. This would help to avoid modifying both. We also need to make sure that native cpu target that is SYCL but doesn't use SPIR is not affected. |
||
// Add any predefined macros associated with intel_gpu* type targets | ||
// passed in with -fsycl-targets | ||
// TODO: Macros are populated during device compilations and saved for | ||
|
@@ -6364,6 +6369,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, | |
Args.addOptOutFlag(CmdArgs, options::OPT_foptimize_sibling_calls, | ||
options::OPT_fno_optimize_sibling_calls); | ||
|
||
Args.addOptOutFlag(CmdArgs, | ||
options::OPT_foffload_use_alloca_addrspace_for_srets, | ||
options::OPT_fno_offload_use_alloca_addrspace_for_srets); | ||
|
||
RenderFloatingPointOptions(TC, D, isOptimizationLevelFast(Args), Args, | ||
CmdArgs, JA, NoOffloadFP32PrecDiv, | ||
NoOffloadFP32PrecSqrt); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the
TODO
message inclang/lib/Driver/ToolChains/Clang.cpp
regarding a temporary fix, should there likewise be a comment here that this CG option is temporary? Or is this part of what will be a permanent fix?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I will add it here too.