Skip to content

Conversation

@aelovikov-intel
Copy link
Contributor

We only use .bc files from libdevice. Another potential implementation for this was to update libdevice's CMakeLists.txt to have separate libdevice-bc and libdevice-non-bc install components and only install the former into rtc-resoruce-install directory. However, that would be intrusive to libdevice with zero benefit there, so I decided to do the filter on the sycl-jit's side inside generate.py.

We only use `.bc` files from libdevice. Another potential implementation
for this was to update libdevice's CMakeLists.txt to have separate
`libdevice-bc` and `libdevice-non-bc` install components and only
install the former into `rtc-resoruce-install` directory. However, that
would be intrusive to libdevice with zero benefit there, so I decided to
do the filter on the sycl-jit's side inside `generate.py`.
@aelovikov-intel
Copy link
Contributor Author

@intel/llvm-reviewers-runtime , Chris is on vacation, can someone review this?


def process_file(file_path):
# We only need .bc files from libdevice:
if re.search(r"[/\\]libsycl-.*\.(o|obj|spv)$", file_path):
Copy link
Contributor

@sarnex sarnex Nov 25, 2025

Choose a reason for hiding this comment

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

would it be simpler to just check if it ends in .bc than to check if it is not bc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is used for .h/.hpp/.inc/etc. files as well (when processing components other than libdevice).

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe im being pedantic but would something like this work?

if "libsycl-" in file_path and file_path.endswith(".bc"):
return

Copy link
Contributor Author

@aelovikov-intel aelovikov-intel Nov 25, 2025

Choose a reason for hiding this comment

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

Let me re-phrase, it's better to embed more than not to embed something necessary. As such, I think matching a subset of known exclusions is better that skipping everything other than a few known pieces.

As for your exact suggestion, I think you're missing a negation (or I wasn't clear somewhere). .bc are the ones we need, so we shouldn't early return for them.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah yeah sorry the second part needs a negation, but with your explanation it lgtm as is

@aelovikov-intel aelovikov-intel merged commit bb941bd into intel:sycl Nov 25, 2025
29 checks passed
@aelovikov-intel aelovikov-intel deleted the libdevice-bc-only branch November 25, 2025 21:31
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