Skip to content

Conversation

@jmmartinez
Copy link
Contributor

The IRParser offers a higher level API, that allows us to also read bitcode assembly, and not only compiled bitcode.

This allows us to skip the llvm-as %s -o %t.bc step in several tests.
I've only updated 3 tests to show the difference; but we have more than 500 occurrences of llvm-as %s -o in the tests:

$ grep -r "llvm-as %s -o" | cut -d':' -f1 | sort -u | wc -l
506

As a bonus, the function llvm::getLazyIRFileModule (https://llvm.org/doxygen/namespacellvm.html#aac226baa3ffd0f255a8d2b6d978b81b2) also calls MemoryBuffer::getFileOrSTDIN.

The IRParser offers a higher level API, that allows us to also read
bitcode assembly, and not only compiled bitcode.

This allows us to skip the `llvm-as %s -o %t.bc` step in several tests.

I only updated 3 tests to show the difference; but we have more than
500 occurences of `llvm-as %s -o` in the tests:

> $/repo/test$ grep -r "llvm-as %s -o" | cut -d':' -f1 | sort -u | wc -l
> 506
@CLAassistant
Copy link

CLAassistant commented Oct 20, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@MrSidims MrSidims left a comment

Choose a reason for hiding this comment

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

Sound legit, thank you!

@MrSidims MrSidims requested a review from svenvh October 20, 2025 13:39
@jmmartinez
Copy link
Contributor Author

There is a strange fail in intel-gather-scatter.ll. I'll check.

@jmmartinez
Copy link
Contributor Author

There is a strange fail in intel-gather-scatter.ll. I'll check.

I'm clueless since it seems to work on my system (with debug and asan enabled). I'll try to rerun the CI jobs re-check.

@MrSidims
Copy link
Contributor

@jmmartinez I believe it's unrelated with your PR as I also see the same failure in #3398 . Taking a look

@MrSidims MrSidims merged commit 400be51 into KhronosGroup:main Oct 21, 2025
6 of 9 checks passed
@jsji
Copy link
Contributor

jsji commented Oct 21, 2025

There is a strange fail in intel-gather-scatter.ll. I'll check.

intel-gather-scatter.ll should be due to community IR change
llvm/llvm-project@573ca36

@MrSidims @svenvh Can we find someone to fix it? Thanks!

@MrSidims
Copy link
Contributor

@jsji FYI #3406

@jsji
Copy link
Contributor

jsji commented Oct 21, 2025

@jsji FYI #3406

Thank you so much!

MrSidims pushed a commit that referenced this pull request Oct 22, 2025
This is a follow-up of
#3399 .

After #3399,
we do not need to run `llvm-as`, we can directly consume the textual
llvm-ir representation.

This patch profits from this to clean this pattern in the test:
```bash
RUN: llvm-as %s -o %t.bc
RUN: llvm-spirv %t.bc ...
```
And replaces it by
```bash
RUN: llvm-spirv %s ...
```
jsji pushed a commit to intel/llvm that referenced this pull request Nov 4, 2025
This is a follow-up of
KhronosGroup/SPIRV-LLVM-Translator#3399 .

After KhronosGroup/SPIRV-LLVM-Translator#3399,
we do not need to run `llvm-as`, we can directly consume the textual
llvm-ir representation.

This patch profits from this to clean this pattern in the test:
```bash
RUN: llvm-as %s -o %t.bc
RUN: llvm-spirv %t.bc ...
```
And replaces it by
```bash
RUN: llvm-spirv %s ...
```

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@57c254d32ea287a
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.

5 participants