-
Notifications
You must be signed in to change notification settings - Fork 769
[ESIMD][NFC] Extract ESIMD handling from sycl-post-link to library. #18684
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
base: sycl
Are you sure you want to change the base?
Conversation
This change extracts handleESIMD from sycl-post-link to SYCLPostLink component for reuse in NewOffloading compilation flow in clang and for reuse in sycl-jit. The documentation of lowerESIMDConstructs are fixed and the argument name is changed to more straightforward.
"Split modules aren't expected to be more than 2."); | ||
if (Result.size() == 2 && SplitOccurred && | ||
SplitMode == module_split::SPLIT_PER_KERNEL && !SplitESIMD) | ||
return createStringError("SYCL and ESIMD entry points detected with " |
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.
I'm not sure I understand this error message. Does it mean that if the modules contain both SYCL and ESIMD entry points, then split-mode=per-kernel
and split-esimd=false
are incompatible?
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.
size == 2
means that we have at least 1 ESIMD entry point and at least 1 non-ESIMD entry point.
-split-esimd=false
would lead to linking 2 entry points into common module.
SPLIT_PER_KERNEL
dictates that one module should contain only 1 entry point.
This is a controversial state that has been initially mentioned in the comment. However, there is a aspect that it has been initially a warning while my PR makes this an error which is not NFC. I could consider to leave it as a warning.
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.
I'm not against the error, but the wording is quite confusing to me. I'd go for something like "--split-esimd=false
is incompatible with split-mode=per-kernel
".
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.
In fact, -split-esimd=false
is compatible with split by kernel in terms of input arguments. The problem in that place is a combination of factors: Result.size() == 2
, -split-esimd=false
and split-mode=per-kernel
.
The following combination is alright: Result.size() == 1
, split-esimd=false
, split-mode=per-kernel
.
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.
LGTM overall. Minor nit.
I also have a question. Will it be reasonable to add a unittest for testing this functionality?
(location: llvm/unittests)
Not a blocker though.
Thanks
Speaking of the testing, different parts are being tested by LIT tests by |
This change extracts handleESIMD from sycl-post-link to SYCLPostLink component for reuse in NewOffloading compilation flow in clang and for reuse in sycl-jit.
The body of
handleESIMD
function is refactored for better readability.The documentation of lowerESIMDConstructs is fixed and the argument name is changed to more straightforward.