-
Notifications
You must be signed in to change notification settings - Fork 246
Add translation for llvm.modf.* #3100
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 translation for llvm.modf.* #3100
Conversation
| declare float @llvm.atan2.f32(float, float) | ||
|
|
||
| ; CHECK: Function | ||
| ; CHECK: FunctionParameter {{[0-9]+}} [[x:[0-9]+]] |
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.
Please add a check for OpVariable
lib/SPIRV/SPIRVWriter.cpp
Outdated
| BM->addPointerType(StorageClassFunction, IntegralTy); | ||
| SPIRVValue *Ptr = BM->addVariable(IntegralPtrTy, nullptr, false, | ||
| spv::internal::LinkageTypeInternal, | ||
| nullptr, "", StorageClassFunction, BB); |
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.
Ideally it should be not current BB, but entry BB of the functions to satisfy "All OpVariable instructions in a function must be in the first block in the function".
SPIRVFunction class in the translator has BB vector, so it might be possible to query first basic block and then call getVariableInsertionPoint to get a place where to insert OpVariable (or alternatively just create alloca in the beginning of the function using LLVM API and call transValue here).
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.
Sorry, thanks for the reminder! LGTM.
Based on KhronosGroup/SPIRV-LLVM-Translator#3100, I'm adding translation for `llvm.modf.*` intrinsics.
…#147556) Based on KhronosGroup/SPIRV-LLVM-Translator#3100, I'm adding translation for `llvm.modf.*` intrinsics.
Based on KhronosGroup/SPIRV-LLVM-Translator#3100, I'm adding translation for `llvm.modf.*` intrinsics.
Based on KhronosGroup/SPIRV-LLVM-Translator#3100, I'm adding translation for `llvm.modf.*` intrinsics.
…cherry-pick (#19725) Cherry-pick the patch llvm/llvm-project@1d02de28dd6: ``` Based on KhronosGroup/SPIRV-LLVM-Translator#3100, I'm adding translation for `llvm.modf.*` intrinsics. ``` And reenable tests that were unsupported because of this issue. Fixes #17813.
Add translation for
llvm.modf.*intrinsics.