Issue with some avx512 intrinsics ({min,max}_ep{i,u}{32,64})

This issue is derived from Open MPI’s op_avx plugin, as it doesn’t compile with NVHPC (21.9, 21.11, 22.1), see also

Here’s the error for the below code in op_avx.c – this compiles without issue with GCC and ICC, and with NVHPC 21.7.

$ nvc -tp skylake op_avx.c 
/cvmfs/soft.computecanada.ca/gentoo/2020/usr/x86_64-pc-linux-gnu/binutils-bin/2.33.1/ld: /tmp/nvclwCcHEoai04S.o: in function `_mm512_max_epu32':
/cvmfs/restricted.computecanada.ca/easybuild/software/2020/Core/nvhpc/22.1/Linux_x86_64/22.1/compilers/include/avx512fintrin.h:1111: undefined reference to `llvm.x86.avx512.pmaxu.d'
/cvmfs/soft.computecanada.ca/gentoo/2020/usr/x86_64-pc-linux-gnu/binutils-bin/2.33.1/ld: /tmp/nvclwCcHEoai04S.o: in function `_mm512_max_epi64':
/cvmfs/restricted.computecanada.ca/easybuild/software/2020/Core/nvhpc/22.1/Linux_x86_64/22.1/compilers/include/avx512fintrin.h:1133: undefined reference to `llvm.x86.avx512.pmaxs.q'
/cvmfs/soft.computecanada.ca/gentoo/2020/usr/x86_64-pc-linux-gnu/binutils-bin/2.33.1/ld: /tmp/nvclwCcHEoai04S.o: in function `_mm512_max_epu64':
/cvmfs/restricted.computecanada.ca/easybuild/software/2020/Core/nvhpc/22.1/Linux_x86_64/22.1/compilers/include/avx512fintrin.h:1155: undefined reference to `llvm.x86.avx512.pmaxu.q'
/cvmfs/soft.computecanada.ca/gentoo/2020/usr/x86_64-pc-linux-gnu/binutils-bin/2.33.1/ld: /tmp/nvclwCcHEoai04S.o: in function `_mm512_min_epi32':
/cvmfs/restricted.computecanada.ca/easybuild/software/2020/Core/nvhpc/22.1/Linux_x86_64/22.1/compilers/include/avx512fintrin.h:1324: undefined reference to `llvm.x86.avx512.pmins.d'
/cvmfs/soft.computecanada.ca/gentoo/2020/usr/x86_64-pc-linux-gnu/binutils-bin/2.33.1/ld: /tmp/nvclwCcHEoai04S.o: in function `_mm512_min_epu32':
/cvmfs/restricted.computecanada.ca/easybuild/software/2020/Core/nvhpc/22.1/Linux_x86_64/22.1/compilers/include/avx512fintrin.h:1346: undefined reference to `llvm.x86.avx512.pminu.d'
/cvmfs/soft.computecanada.ca/gentoo/2020/usr/x86_64-pc-linux-gnu/binutils-bin/2.33.1/ld: /tmp/nvclwCcHEoai04S.o: in function `_mm512_min_epi64':
/cvmfs/restricted.computecanada.ca/easybuild/software/2020/Core/nvhpc/22.1/Linux_x86_64/22.1/compilers/include/avx512fintrin.h:1368: undefined reference to `llvm.x86.avx512.pmins.q'
/cvmfs/soft.computecanada.ca/gentoo/2020/usr/x86_64-pc-linux-gnu/binutils-bin/2.33.1/ld: /tmp/nvclwCcHEoai04S.o: in function `_mm512_min_epu64':
/cvmfs/restricted.computecanada.ca/easybuild/software/2020/Core/nvhpc/22.1/Linux_x86_64/22.1/compilers/include/avx512fintrin.h:1390: undefined reference to `llvm.x86.avx512.pminu.q'
#include <immintrin.h>

int main(int argc, char **argv)
{
    __m512i vecA = _mm512_loadu_si512((__m512 *)argv[0]);
    __m512i vecB = _mm512_loadu_si512((__m512 *)argv[1]);
    vecB = _mm512_max_epi64(vecA, vecB);
    vecB = _mm512_min_epi64(vecA, vecB);
    vecB = _mm512_max_epu64(vecA, vecB);
    vecB = _mm512_min_epu64(vecA, vecB);
    vecB = _mm512_max_epi32(vecA, vecB);
    vecB = _mm512_min_epi32(vecA, vecB);
    vecB = _mm512_max_epu32(vecA, vecB);
    vecB = _mm512_min_epu32(vecA, vecB);
    return (int)((char *)&vecB)[0];
}

Thanks Bart. I recreated the issue here and filed a problem report, TPR #31204. We’ll have engineering investigate.

-Mat

Update: I separately filed TPR #31209 on the same issue, as we have seen it pop up from a few other places recently as well. I included the reproducer from the Open MPI issue tracker. I have assigned it to an engineer for investigation.