llvm / llvm/Polygeist

Does Polygeist Support AVX Instructions?

Open
#362 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
624
Forks
170
PR merge metrics
No merged PRs in 30d

Description

Hello,

I am working on some performance-sensitive projects that make heavy use of AVX instructions. I've been exploring using Polygeist for code optimization and wanted to know how well it supports AVX.

While trying to compile some code that includes AVX instructions with `cgeist`, I encountered some errors related to unrecognized built-ins such as `__builtin_ia32_addss`. This led me to wonder about the level of support for AVX in Polygeist.

Here is a brief snippet that reproduces the issue:
```c
#include

void example_function() {
__m256i a;
......
}
```

The command I used to compile is:
```shell
cgeist -O0 example_code.c -I/usr/lib/gcc/x86_64-linux-gnu/9/include --function=example_function -S -o output.mlir
```

The error message was:
```shell
In file included from example_code.c:1:
/usr/lib/gcc/x86_64-linux-gnu/9/include/immintrin.h:29:
/usr/lib/gcc/x86_64-linux-gnu/9/include/xmmintrin.h:130:19: error: use of unknown builtin '__builtin_ia32_addss' [-Wimplicit-function-declaration]
return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B);
```

Could you please confirm whether Polygeist currently supports AVX instructions? If not, are there any plans to add this support in future releases?

Thank you for your time and assistance.

Best regards

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported command with example_code.c, cgeist, and the included immintrin.h path, then inspect how the unknown __builtin_ia32_addss diagnostic is handled. Determine the current AVX support boundary and document the result or a concrete scope for adding support.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.