-
Notifications
You must be signed in to change notification settings - Fork 3.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
[Target] LLVM helper functions for any target info #15761
Conversation
This is awesome! Could you guys help review? @Lunderberg @vvchernov @kparzysz-quic @echuraev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @cbalint13! Thank you for your work! LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbalint13 Thank you for the nice improvements! LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code should be in LLVMTargetInfo
. Could move it there?
Hi @kparzysz-quic , Thank you for the review !
Not sure about how to integrate there. These (optional) helpers can be used independently, much earlier, prior emitting or llvm lowering steps. Help me with a hint/idea about. |
The idea behind The functions you wrote can be moved to llvm_instance.cc. They can create a temporary LLVMInstance object, get LLVMTargetInfo, get the Btw, the functionality you're adding is great, what I'm asking for is to integrate it with the existing code. Edit: the query functions you have written don't need to be members of |
Thanks again taking time !
Thank you much for the feedback !
See now, again thanks much for the time ! |
We're trying to prevent the LLVM state from being persistent. The specific use-case was using command-line options with LLVM. Once you set use some flags, their effects will persist, and LLVM may even prevent you from using the same flags again. The workflow is
|
Added the fuctions as Changes:
Caevats:
It is not possible to avoid explicit |
Hey @cbalint13, I got a compiler warning from this commit saying:
I am a bit confused by the warning message, not completely sure if it is false positive from the compiler, so am following up here to double check |
Hmm, if it's about |
Hi folks,
This PR adds helper functions to query any LLVM information about: targets, arches and it's features.
It can enhance TVM target handling with information from LLVM module, just like partially was done in: #15685
Changes:
llvm_get_targets()
,llvm_get_cpu_archlist()
,llvm_get_cpu_features()
&llvm_cpu_has_features()
target_has_feature()
to work with any target, now also having-mtriple
/-mattr
awarenessUsage example
Cc: @kparzysz-quic , @Lunderberg , @areusch , @junrushao , @tqchen , @elvin-n , @vvchernov , @echuraev
Thank you,
~Cristian.