Skip to content
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 handling for SIMD constants in Mono #81482

Closed
Tracked by #43051
tannergooding opened this issue Feb 1, 2023 · 1 comment · Fixed by #81902
Closed
Tracked by #43051

Add handling for SIMD constants in Mono #81482

tannergooding opened this issue Feb 1, 2023 · 1 comment · Fixed by #81902

Comments

@tannergooding
Copy link
Member

Today mono has some SIMD support but it doesn't have any way to special case the introduction of "simd constants" and it always introduces "new values" by creating a "zero value" and then a separate insert node for each element.

This works and even gets optimized in most cases by LLVM. However, it also can represent a non-trivial amount of IR being introduced (Vector256<byte> is 32 inserts) and can hinder some opportunistic optimizations lighting up earlier.

I propose that mono introduce a MONO_EMIT_NEW_VCONST or similar. On LLVM this would defer down to llvm::ConstantDataVector (for the LLVM-C API this is LLVMConstVector).

Likewise it should take advantage of the other LLVM APIs such as LLVMConstExtractElement, LLVMConstInsertElement, and LLVMConstShuffleVector as this should lead to an increase in throughput and some better codegen.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 1, 2023
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@fanyang-mono fanyang-mono added this to the Future milestone Feb 1, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Feb 1, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants