-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Add loop pragmas #31376
base: master
Are you sure you want to change the base?
Add loop pragmas #31376
Conversation
@vchuravy Can you rebase this on the latest master? |
It looks like this PR has tests now, so I'm removing the "needs tests" label. |
3a27fc7
to
1264754
Compare
I think the big picture question here is what the user interface is supposed to be. I don't think we should have indivdual macros for each variant, and how does one note multiple loop pragmas at once? |
Also documentation can be found here https://llvm.org/docs/TransformMetadata.html and here https://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-loop-hint-optimizations |
Personally I don't mind the "individual macros" approach. But we could have a single macro
|
Btw, the LLVM docs don't quite match what we have in this PR? E.g. in this PR, But https://llvm.org/docs/TransformMetadata.html does not mention Presumably it sets the unroll factor. But it's not in the docs. |
04e3e00
to
b327bf7
Compare
It's not mentioned there, but is the IR version of |
Needs API design work to make progress. |
FWIW, I would really like to see this merged. Anything I can help with? |
I am really not happy with the UX design, but I haven't had any better ideas. You can see that I only exposed a few and then got frustrated with the plethora of names. There is also a compositionality question. E.g. |
based on #31347, the loopinfo Expr allows us to communicate various pieces of information about loops to LLVM, in the C/OpenMP world these are know as loop pragmas.
They are optional metadata and LLVM can choose to discard it so it is not the best mechanism.
Mostly putting this up so that we can discuss the user-facing interface (which I have no strong feelings about.)