Skip to content

[WIP][SYCL] Make sycl-post-link process split modules sequentially, simplify. #5001

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

Closed
wants to merge 1 commit into from

Conversation

kbobrovs
Copy link
Contributor

  • Split module extraction is now done sequentially, not keeping all
    modules resulting from split alive in RAM.
  • Post link actions are separated into clear parts simplifying the logic
  • Initial support for keeping SYCL and ESIMD code in the same module, needed
    for invoke_simd.
  • Add convenience constructor to SimpleTable.

Signed-off-by: Konstantin S Bobrovsky [email protected]

- Split module extraction is now done sequentially, not keeping all
  modules resulting from split alive in RAM.
- Post link actions are separated into clear parts simplifying the logic
- Initial support for keeping SYCL and ESIMD code in the same module, needed
  for invoke_simd.
- Add convenience constructor to SimpleTable.

Signed-off-by: Konstantin S Bobrovsky <[email protected]>
TableFiles TblFiles;
if (!M)
return TblFiles;
struct IrPropSymFilenameTripple {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
struct IrPropSymFilenameTripple {
struct IrPropSymFilenameTriple {

if (DoSymGen) {
ColumnTitles.push_back(COL_SYM);
}
std::unique_ptr<util::SimpleTable> Table = std::make_unique<util::SimpleTable>(ColumnTitles);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::unique_ptr<util::SimpleTable> Table = std::make_unique<util::SimpleTable>(ColumnTitles);
auto Table = std::make_unique<util::SimpleTable>(ColumnTitles);

Comment on lines +614 to +616
const Function *F1 = dyn_cast_or_null<Function>(VMap[F]);
assert(F1 && "clone error");
return F1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const Function *F1 = dyn_cast_or_null<Function>(VMap[F]);
assert(F1 && "clone error");
return F1;
return cast<Function>(VMap[F]);


std::unique_ptr<Module> M = nullptr;
std::vector<const Function*> EntryPoints;
std::string Name = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that this field is not used now.

Comment on lines +986 to +996
std::pair<IRModuleDesc, IRModuleDesc> SyclEsimdModules = splitSyclEsimd(M1);
IRModuleDesc &MSycl = SyclEsimdModules.first;
IRModuleDesc &MEsimd = SyclEsimdModules.second;
SmallVector<IRModuleDesc, 2> MMs;

if (MSycl.M.get()) {
MMs.emplace_back(std::move(SyclEsimdModules.first));
}
if (MEsimd.M.get()) {
MMs.emplace_back(std::move(SyclEsimdModules.second));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::pair<IRModuleDesc, IRModuleDesc> SyclEsimdModules = splitSyclEsimd(M1);
IRModuleDesc &MSycl = SyclEsimdModules.first;
IRModuleDesc &MEsimd = SyclEsimdModules.second;
SmallVector<IRModuleDesc, 2> MMs;
if (MSycl.M.get()) {
MMs.emplace_back(std::move(SyclEsimdModules.first));
}
if (MEsimd.M.get()) {
MMs.emplace_back(std::move(SyclEsimdModules.second));
}
SmallVector<IRModuleDesc, 2> MMs = splitSyclEsimd(M1);
Modified = (MMs.size() > 1);

Comment on lines +59 to +60
; CHECK-PROP2-NOT: [SYCL/specialization constants]
; CHECK-PROP2-NOT: [SYCL/specialization constants default values]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
; CHECK-PROP2-NOT: [SYCL/specialization constants]
; CHECK-PROP2-NOT: [SYCL/specialization constants default values]
; CHECK-PROP2-NOT: [SYCL/specialization constants

@kbobrovs
Copy link
Contributor Author

@mlychkov - thanks for the review. Per our today's discussion, I will wait for your two PRs - the cosmetic one and the one which will process split modules one-by-one (which might borrow some code from this patch). After that I will rebase this patch and continue the review/merge process.

mlychkov added a commit to mlychkov/llvm that referenced this pull request Nov 23, 2021
@mlychkov
Copy link
Contributor

@mlychkov - thanks for the review. Per our today's discussion, I will wait for your two PRs - the cosmetic one and the one which will process split modules one-by-one (which might borrow some code from this patch). After that I will rebase this patch and continue the review/merge process.

@kbobrovs Both PRs have been merged. You may rebase and continue work under this patch.

@kbobrovs
Copy link
Contributor Author

Replaced with #6160

@kbobrovs kbobrovs closed this May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants