Skip to content
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

[SandboxIR] Implement GlobalIFunc #108622

Merged
merged 1 commit into from
Sep 13, 2024
Merged

[SandboxIR] Implement GlobalIFunc #108622

merged 1 commit into from
Sep 13, 2024

Conversation

vporpo
Copy link
Contributor

@vporpo vporpo commented Sep 13, 2024

This patch implements sandboxir::GlobalIFunc mirroring llvm::GlobalIFunc.

This patch implements sandboxir::GlobalIFunc mirroring llvm::GlobalIFunc.
@vporpo
Copy link
Contributor Author

vporpo commented Sep 13, 2024

The windows bot error does not seem to be related to this, so I will merge it.

@vporpo vporpo merged commit ae3e825 into llvm:main Sep 13, 2024
6 of 8 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 13, 2024

LLVM Buildbot has detected a new failure on builder openmp-s390x-linux running on systemz-1 while building llvm at step 6 "test-openmp".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/88/builds/2501

Here is the relevant piece of the build log for the reference
Step 6 (test-openmp) failure: test (failure)
******************** TEST 'libomp :: tasking/issue-94260-2.c' FAILED ********************
Exit Code: -11

Command Output (stdout):
--
# RUN: at line 1
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/./bin/clang -fopenmp   -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test -L /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -fno-omit-frame-pointer -mbackchain -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/ompt /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/tasking/issue-94260-2.c -o /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp -lm -latomic && /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp
# executed command: /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/./bin/clang -fopenmp -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test -L /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -fno-omit-frame-pointer -mbackchain -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/ompt /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/tasking/issue-94260-2.c -o /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp -lm -latomic
# executed command: /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp
# note: command had no output on stdout or stderr
# error: command failed with exit status: -11

--

********************


@nikic
Copy link
Contributor

nikic commented Sep 13, 2024

Why does sandbox IR have to mirror something as exotic as GlobalIFunc, which should not be relevant to vectorization. Can sandbox IR reference opaque values for things outside its scope?

@vporpo
Copy link
Contributor Author

vporpo commented Sep 13, 2024

Why does sandbox IR have to mirror something as exotic as GlobalIFunc, which should not be relevant to vectorization.

We are trying to make Sandbox IR as generic as possible, so that it can be used in other contexts if needed. GlobalIFunc and a few others are indeed quite exotic and won't probably be used.

Can sandbox IR reference opaque values for things outside its scope?

It can, but we would rather not rely on it if possible. It's better to have a Sandbox IR class for something exotic, even it's missing some functionality compared to LLVM IR, rather than having an opaque object.

@nikic
Copy link
Contributor

nikic commented Sep 13, 2024

Mirroring unnecessary things into SandboxIR increases the burden on maintaining IR, because any change to IR has to be synced to SandboxIR. In that respect, it would be preferable if SandboxIR only mirrored the parts that are necessary to the prototype of the sandbox vectorizer. It looks like it currently tries to mirror all APIs of all types in the Value hierarchy.

You can always add more things as they become necessary, but once something is there it has a continuous cost.

@vporpo
Copy link
Contributor Author

vporpo commented Sep 13, 2024

Yes, there is a cost, but I would argue that it is rather limited, because the implementation of most Sandbox IR APIs is quite trivial: they just call the LLVM API internally. If it does end up becoming a maintenance burden for whatever reason, dropping the SandboxIR API is always an option.

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.

4 participants