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

New LLVM version will conflict with macros defined in TritonGPUToLLVM/Utility.h #5691

Open
gflegar opened this issue Jan 24, 2025 · 1 comment

Comments

@gflegar
Copy link
Collaborator

gflegar commented Jan 24, 2025

Heads up that a new LLVM version will cause macros from TritonGPUToLLVM/Utility.h to be expanded in LLVM's own headers and lead to compilation failures. To work around that we currently have this hack, which is obviously far from ideal.

I'm wondering how folks here would want to solve this issue? I do get the convenience of using these macros, but TBH they always seemed to me like quite a footgun with fallout from it just waiting to happen. My suggestion would be to replace them with a class LLVMBuilder that encapsulates loc and rewriter and defines the methods that used to be macros. Something like this:

LLVMBuilder b(rewriter, loc);
...
r = b.fma(a, b, c);
...

This way it's still quite concise, but avoids all the issues with macros.

WDYT?

@gflegar gflegar changed the title New LLVM version will conflict with macros defined in triton/Conversion/TritonGPUToLLVM/Utility.h New LLVM version will conflict with macros defined in TritonGPUToLLVM/Utility.h Jan 24, 2025
@peterbell10
Copy link
Contributor

This makes a lot of sense to me.

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

No branches or pull requests

2 participants