Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

How can I generate SVE vectors with LLVM #47648

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR48679
Status NEW
Importance P normal
Reported by Yang Zhihui (yangzh.fnst@cn.fujitsu.com)
Reported on 2021-01-06 18:57:58 -0800
Last modified on 2021-05-05 04:56:25 -0700
Version 11.0
Hardware PC Linux
CC blitzrakete@gmail.com, cullen.rhodes@arm.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, matdzb@gmail.com, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
Hello,

LLVM always generate NEON vectors, but I want it generate SVE vectors. How can
I do this?

clang version 11.0.0

example.c:

#define ARRAYSIZE 1024
int a[ARRAYSIZE];
int b[ARRAYSIZE];
int c[ARRAYSIZE];
void subtract_arrays(int *restrict a, int *restrict b, int *restrict c)
{
    for (int i = 0; i < ARRAYSIZE; i++)
    {
        a[i] = b[i] - c[i];
    }
}

int main()
{
    subtract_arrays(a, b, c);
}
command:
clang --target=aarch64-linux-gnu -march=armv8-a+sve -O3 -S example.c

Thanks
Quuxplusone commented 3 years ago
Hi Yang,

Support for VLA auto-vectorization is ongoing but there is fixed-length support
using SVE. To enable this, specify the vector length in bits with `-mllvm
-aarch64-sve-vector-bits-min=`.

There's an SVE sync-up meeting with the community once a month going forward,
the exact date for the next one (first meeting this year) is still being
decided, but should be between 18th-22nd January. If you're interested you can
sign up here:

    https://docs.google.com/document/d/1SODSKta18QHofMaZIZWn1PIkieHQTqOGk3W1zu4fnjQ/edit

Thanks,
Cullen