-
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
Merged
aelovikov-intel
merged 16 commits into
intel:sycl
from
Fznamznon:option-for-sret-change
Apr 22, 2025
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
dbe18de
Initial change for testing
Fznamznon 53d4d29
Fix crashes related to lifetimes emission
Fznamznon 5e569a7
Additional changes to make the option work in non-SYCL modes
premanandrao 9d98cde
Fix clang-format issues
premanandrao 3c3ad27
Revert "Merge commit '3a353b1faa83' into llvmspirv_pulldown"
premanandrao 4dee04d
Revert "Revert "Merge commit '3a353b1faa83' into llvmspirv_pulldown""
premanandrao 408135b
Fix some tests that were changed earlier
premanandrao c790e52
One more test
premanandrao 78901db
Remove false check
premanandrao ee42c37
Apply FE review comments
premanandrao ad66fb3
Move new option to minimize modifying tests
premanandrao 54f722a
clang-format; inadvertent spaces
premanandrao 04b377d
Remove extra line
premanandrao 0c4b489
Disable the option when target is SPIR
premanandrao 6760adb
Remove test exclusion; modify test to check other mode
premanandrao 8edcba2
Rename FileCheck string to please clang-format
premanandrao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5684,7 +5684,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, | |
// We want to compile sycl kernels. | ||
CmdArgs.push_back("-fsycl-is-device"); | ||
CmdArgs.push_back("-fdeclare-spirv-builtins"); | ||
|
||
// Set O2 optimization level by default | ||
if (!Args.getLastArg(options::OPT_O_Group)) | ||
CmdArgs.push_back("-O2"); | ||
|
@@ -6052,10 +6052,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, | |
// are provided. | ||
TC.addClangWarningOptions(CmdArgs); | ||
|
||
// FIXME: Subclass ToolChain for SPIR/SPIR-V and move this to | ||
// addClangWarningOptions. | ||
if (Triple.isSPIROrSPIRV()) | ||
if (Triple.isSPIROrSPIRV()) { | ||
// FIXME: Subclass ToolChain for SPIR/SPIR-V and move this to | ||
// addClangWarningOptions. | ||
CmdArgs.push_back("-Wspir-compat"); | ||
// Disable this option for SPIR targets. | ||
// 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. Updated change LGTM |
||
|
||
// Select the appropriate action. | ||
RewriteKind rewriteKind = RK_None; | ||
|
@@ -6364,6 +6368,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); | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
# Please use "#" to add comments here. | ||
# Do not delete the file even if it's empty. | ||
# CMPLRLLVM-66370 | ||
hierarchical |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, is this option intended to be temporary? If so, perhaps add a comment stating so.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.
Sure, will do.
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.
Thanks! Looks good.