[llvm-dev] error of using GATHER intrinsic

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 20 13:21:48 PST 2016


> Only typo that caught my eye is ‘llvm.masked.gather.v8f64’ which should have v2 instead of v8 to match the <2 x double>

There's an extra comma after an "i1" too. But they both just result in
LLVM rejecting the code immediately.

> But it still fails if I use -mcpu=core-avx2.

My simple tests get correctly expanded to scalar loads. I've still not
seen a selection failure.

> It seems that avx2 supports gather/scatter, but I am not sure why it doesn't work.

AVX2 supports some gather instructions, but they're more limited than
the AVX-512 variants ones @llvm.masked.gather was added for. It looks
like you can get the AVX2 ones using x86-specific intrinsics (look for
@llvm.x86.avx2.gather.d.pd etc in tests/CodeGen/X86).

It might make sense to use the AVX2 ones for @llvm.masked.gather as
well, but there would be more register shuffling so it might not.
Either way, no-one seems to have done so yet.

Cheers.

Tim.


More information about the llvm-dev mailing list