[llvm-bugs] [Bug 27779] New: target attribute doesn't know about avx512vl, can cause compiler crashes

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 16 11:35:22 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27779

            Bug ID: 27779
           Summary: target attribute doesn't know about avx512vl, can
                    cause compiler crashes
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

thakis at thakis:~/src/llvm-build$ cat test.cc
#include <x86intrin.h>
__attribute__((target("avx512vl"))) void f_avx512() {
  __mmask8 mask;
  __m256i m;
  _mm256_mask_abs_epi32(m, mask, m);
}
void f() {}

int main() {
  if (__builtin_cpu_supports("avx512vl"))
    f_avx512();
}

thakis at thakis:~/src/llvm-build$ bin/clang -c test.cc
test.cc:10:7: error: invalid cpu feature string for builtin
  if (__builtin_cpu_supports("avx512vl"))
      ^                      ~~~~~~~~~~
1 error generated.


If I change the argument to __builtin_cpu_supports to e.g. "avx", then clang
crashes:

thakis at thakis:~/src/llvm-build$ cat test.cc
#include <x86intrin.h>
__attribute__((target("avx512vl"))) void f_avx512() {
  __mmask8 mask;
  __m256i m;
  _mm256_mask_abs_epi32(m, mask, m);
}
void f() {}

int main() {
  if (__builtin_cpu_supports("avx"))
    f_avx512();
}

thakis at thakis:~/src/llvm-build$ bin/clang -c test.cc
fatal error: error in backend: Cannot select: t19: ch = store<ST32[%5]> t15,
t35, FrameIndex:i64<4>, undef:i64
  t35: v32i8 = bitcast t34
    t34: v4i64,ch = load<LD32[%6]> t15, FrameIndex:i64<7>, undef:i64
      t7: i64 = FrameIndex<7>
      t3: i64 = undef
  t17: i64 = FrameIndex<4>
  t3: i64 = undef
In function: _Z8f_avx512v
clang-3.8: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 3.9.0 (trunk 268802)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/google/home/thakis/src/llvm-build/bin
clang-3.8: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.8: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.8: note: diagnostic msg: /tmp/test-8869f8.cpp
clang-3.8: note: diagnostic msg: /tmp/test-8869f8.sh
clang-3.8: note: diagnostic msg: 

********************

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160516/1e9c4eeb/attachment.html>


More information about the llvm-bugs mailing list