-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Conversation
This patch implements sandboxir::GlobalIFunc mirroring llvm::GlobalIFunc.
The windows bot error does not seem to be related to this, so I will merge it. |
LLVM Buildbot has detected a new failure on builder 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
|
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? |
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.
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. |
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. |
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. |
This patch implements sandboxir::GlobalIFunc mirroring llvm::GlobalIFunc.