Skip to content

Fix support of SPV_INTEL_vector_compute#1176

Merged
AlexeySotkin merged 2 commits intoKhronosGroup:masterfrom
Fznamznon:fix-lower-types-2
Aug 26, 2021
Merged

Fix support of SPV_INTEL_vector_compute#1176
AlexeySotkin merged 2 commits intoKhronosGroup:masterfrom
Fznamznon:fix-lower-types-2

Conversation

@Fznamznon
Copy link
Contributor

The previous patch has fixed only case with 1-element vectors, however
after closer look at the spec it became clear that
SPV_INTEL_vector_compute actually allows any number of vector elements
(capability VectorAnyINTEL), so this is the proper fix.

The previous patch has fixed only case with 1-element vectors, however
after closer look at the spec it became clear that
SPV_INTEL_vector_compute actually allows any number of vector elements
(capability VectorAnyINTEL), so this is the proper fix.
!(Opts.isAllowedToUseExtension(
ExtensionID::SPV_INTEL_vector_compute) &&
NumElemsInSrcVec == 1))
!Opts.isAllowedToUseExtension(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case if this extension is included we doesn't lowering any instructions with vector types.
Maybe to move this check just to the beginning of this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just thinking that maybe this pass will lower not only vector instructions one day, so I left it here. Do you think it is possible?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we might rename this concrete method to use it for non standard vectors lowering only. And to write new functions for lowering other non supported patterns. It would make these changes atomic to each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've moved check to the beginning.

// in pure SPIR-V number of components, there is no need to do anything in
// case SPV_INTEL_vector_compute is enabled.
if (Opts.isAllowedToUseExtension(ExtensionID::SPV_INTEL_vector_compute))
return PreservedAnalyses::all();
Copy link
Contributor

@AlexeySotkin AlexeySotkin Aug 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is out of scope of this patch, but it is strange that we return PreservedAnalyses, because it is not an analysis pass AFAIK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following the logic that was made here before. I'm a newbie in passes that run through new passmanager. Probably @KornevNikita can help to understand it better once returns from vacation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose current method better to return just bool "changed or not".
In main run method PreservedAnalyses should be created depending on changed value.

@AlexeySotkin AlexeySotkin merged commit e9671a5 into KhronosGroup:master Aug 26, 2021
Quetzonarch pushed a commit to Quetzonarch/SPIRV-LLVM-Translator that referenced this pull request Aug 27, 2021
The previous patch has fixed only case with 1-element vectors, however
after closer look at the spec it became clear that
SPV_INTEL_vector_compute actually allows any number of vector elements
(capability VectorAnyINTEL), so this is the proper fix.
DmitryBushev pushed a commit to DmitryBushev/SPIRV-LLVM-Translator that referenced this pull request Oct 19, 2021
The previous patch has fixed only case with 1-element vectors, however
after closer look at the spec it became clear that
SPV_INTEL_vector_compute actually allows any number of vector elements
(capability VectorAnyINTEL), so this is the proper fix.
DmitryBushev pushed a commit to DmitryBushev/SPIRV-LLVM-Translator that referenced this pull request Oct 25, 2021
The previous patch has fixed only case with 1-element vectors, however
after closer look at the spec it became clear that
SPV_INTEL_vector_compute actually allows any number of vector elements
(capability VectorAnyINTEL), so this is the proper fix.
AlexeySotkin pushed a commit that referenced this pull request Oct 26, 2021
The previous patch has fixed only case with 1-element vectors, however
after closer look at the spec it became clear that
SPV_INTEL_vector_compute actually allows any number of vector elements
(capability VectorAnyINTEL), so this is the proper fix.
Quetzonarch pushed a commit to Quetzonarch/SPIRV-LLVM-Translator that referenced this pull request Jul 13, 2022
The previous patch has fixed only case with 1-element vectors, however
after closer look at the spec it became clear that
SPV_INTEL_vector_compute actually allows any number of vector elements
(capability VectorAnyINTEL), so this is the proper fix.
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