Skip to content

[SYCL][OpenMP] Preserve compile-options for spir64 JIT device images - #23616

Open
bviyer wants to merge 3 commits into
syclfrom
bviyer-fix-dropping-omp-flags
Open

bviyer wants to merge 3 commits into
syclfrom
bviyer-fix-dropping-omp-flags

Conversation

@bviyer

@bviyer bviyer commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

The function containerizeRawImages was not capturing the compiler options and thus the options passed by users were dropped. This patch adds CompileOpts/LinkOpts parameters to containerizeRawImage and forwards the options extracted from the input offload files at the call site.

@bviyer
bviyer requested a review from a team as a code owner October 23, 2026 22:30
@bviyer
bviyer requested review from mdtoguchi and sarnex October 23, 2026 22:31

// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o %t.bc
// RUN: %clang_cc1 %s -triple spirv64-intel -fopenmp-is-target-device -emit-obj -o %t.device.o
// RUN: llvm-offload-binary -o %t.bundle "--image=file=%t.device.o,triple=spirv64-intel,arch=generic,kind=openmp,compile-opts=-cl-opt-disable"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should also test link-opts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added.

void __tgt_register_lib(void *) {}
void __tgt_unregister_lib(void *) {}
int atexit(void (*)(void)) { return 0; }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The clang-linker-wrapper call doesn't look to be doing any real linking, so these additional funcs aren't needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@mdtoguchi mdtoguchi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you update the PR summary too?

@bviyer bviyer changed the title Init commit [SYCL][OpenMP] Preserve compile-options for spir64 JIT device images Oct 23, 2026
@bviyer
bviyer requested a review from mdtoguchi October 24, 2026 00:00

This branch has not been deployed

No deployments
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