-
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
[CODEGEN] Vector-Codegen support for llvm-pure-intrin #16985
[CODEGEN] Vector-Codegen support for llvm-pure-intrin #16985
Conversation
deefe06
to
d3be9ab
Compare
@tvm-bot rerun |
cc: @tqchen @Lunderberg |
cc: @cbalint13 @ekalda |
@@ -139,7 +139,8 @@ TIR_DEFINE_BUILTIN_FUNC(call_llvm_intrin) | |||
TIR_DEFINE_BUILTIN_FUNC(call_llvm_pure_intrin) | |||
.set_attr<TCallEffectKind>("TCallEffectKind", Integer(CallEffectKind::kPure)) | |||
.set_attr<TScriptDtypePrintLocation>("TScriptDtypePrintLocation", | |||
Integer(ScriptDtypePrintLocation::kFirst)); | |||
Integer(ScriptDtypePrintLocation::kFirst)) | |||
.set_attr<TVectorizable>("TVectorizable", true); |
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.
Can add a small testcase for the IR printer ?
tests/python/unittest/test_tvmscript_printer_tir.py
@rutkoor |
…or_codegen_llvm_pure_intrin
Hi @cbalint13, thank you for your quick reply. And apologize for not replying back sooner. I have added a testcase inside test_tvmscript_printer_tir.py and also explained what I am doing in the description of this PR. Please let me know if you want me to add more details. Thanks. |
Thank you very much @rutkoor !
|
@tvm-bot rerun |
If we have a loop with llvm intrinsic call like below,
Before,
using sch.vectorize, we cannot generate ramp node for the above code.
In this pull request, I enabled vectorization support for the
llvm_pure_intrin
builtin. During the vectorize pass, I explicitly vectorized the compute expressions that serve as input to the intrinsic. As a result of these changes, I was able to generate the ramp instructions for the expressions inside thecall_llvm_pure_intrin
function.After,
Note: If the intrinsic doesn't support vector arguments as input, then the error will be thrown during llvm codegen.