[Target] LLVM helper functions for any target info#15761
[Target] LLVM helper functions for any target info#15761kparzysz-quic merged 1 commit intoapache:mainfrom cbalint13:main
Conversation
|
This is awesome! Could you guys help review? @Lunderberg @vvchernov @kparzysz-quic @echuraev |
vvchernov
left a comment
There was a problem hiding this comment.
Hello @cbalint13! Thank you for your work! LGTM
There was a problem hiding this comment.
@cbalint13 Thank you for the nice improvements! LGTM!
kparzysz-quic
left a comment
There was a problem hiding this comment.
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/-mattrawarenessUsage example
Cc: @kparzysz-quic , @Lunderberg , @areusch , @junrushao , @tqchen , @elvin-n , @vvchernov , @echuraev
Thank you,
~Cristian.