Skip to content

Conversation

@maarquitos14
Copy link
Contributor

Add translation for llvm.modf.* intrinsics.

@CLAassistant
Copy link

CLAassistant commented Mar 26, 2025

CLA assistant check
All committers have signed the CLA.

declare float @llvm.atan2.f32(float, float)

; CHECK: Function
; CHECK: FunctionParameter {{[0-9]+}} [[x:[0-9]+]]
Copy link
Contributor

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

BM->addPointerType(StorageClassFunction, IntegralTy);
SPIRVValue *Ptr = BM->addVariable(IntegralPtrTy, nullptr, false,
spv::internal::LinkageTypeInternal,
nullptr, "", StorageClassFunction, BB);
Copy link
Contributor

@MrSidims MrSidims Mar 26, 2025

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).

@MrSidims MrSidims requested review from MrSidims and svenvh March 26, 2025 23:00
@maarquitos14
Copy link
Contributor Author

Friendly ping @MrSidims @svenvh

Copy link
Member

@svenvh svenvh left a 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.

@MrSidims MrSidims merged commit 3c45ac7 into KhronosGroup:main Mar 31, 2025
6 of 9 checks passed
jsji added a commit to intel/llvm that referenced this pull request Apr 2, 2025
AlexeySachkov pushed a commit to intel/llvm that referenced this pull request May 28, 2025
MrSidims pushed a commit to llvm/llvm-project that referenced this pull request Jul 21, 2025
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jul 21, 2025
…#147556)

Based on
KhronosGroup/SPIRV-LLVM-Translator#3100, I'm
adding translation for `llvm.modf.*` intrinsics.
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
maarquitos14 added a commit to maarquitos14/llvm that referenced this pull request Aug 6, 2025
againull pushed a commit to intel/llvm that referenced this pull request Aug 6, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants