mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-13 17:37:00 +00:00

This adds a new command line option -mprefer-vector-width to specify a preferred vector width for the vectorizers. Valid values are 'none' and unsigned integers. The driver will check that it meets those constraints. Specific supported integers will be managed by the targets in the backend. Clang will take the value and add it as a new function attribute during CodeGen. This represents the alternate direction proposed by Sanjay in this RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-November/118734.html The syntax here matches gcc, though gcc treats it as an x86 specific command line argument. gcc only allows values of 128, 256, and 512. I'm not having clang check any values. Differential Revision: https://reviews.llvm.org/D40230 llvm-svn: 320419
15 lines
585 B
C
15 lines
585 B
C
// RUN: %clang_cc1 -mprefer-vector-width=128 -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK128
|
|
// RUN: %clang_cc1 -mprefer-vector-width=256 -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK256
|
|
// RUN: %clang_cc1 -mprefer-vector-width=none -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECKNONE
|
|
|
|
int baz(int a) { return 4; }
|
|
|
|
// CHECK128: baz{{.*}} #0
|
|
// CHECK128: #0 = {{.*}}"prefer-vector-width"="128"
|
|
|
|
// CHECK256: baz{{.*}} #0
|
|
// CHECK256: #0 = {{.*}}"prefer-vector-width"="256"
|
|
|
|
// CHECKNONE: baz{{.*}} #0
|
|
// CHECKNONE-NOT: #0 = {{.*}}"prefer-vector-width"="none"
|