diff options
| author | Craig Topper <craig.topper@intel.com> | 2018-10-25 05:04:35 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2018-10-25 05:04:35 +0000 |
| commit | 00897e9b7b88f0435565909480021803c21ca3b7 (patch) | |
| tree | 4b5d607b130d045b1aa07494f4323a7032930b31 | |
| parent | eaa1cf5b574438210eb7f41285c4004ec194749e (diff) | |
| download | bcm5719-llvm-00897e9b7b88f0435565909480021803c21ca3b7.tar.gz bcm5719-llvm-00897e9b7b88f0435565909480021803c21ca3b7.zip | |
[CodeGen] Always emit the 'min-legal-vector-width' attribute even when the value is 0.
The X86 backend will need to see the attribute to make decisions. If it isn't present the backend will have to assume large vectors may be present.
llvm-svn: 345237
| -rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 4 | ||||
| -rw-r--r-- | clang/test/CodeGen/aarch64-neon-ldst-one.c | 2 | ||||
| -rw-r--r-- | clang/test/CodeGen/aarch64-poly64.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 41bde79abab..700723189ed 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -448,9 +448,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { // 4. Width of vector arguments and return types for this function. // 5. Width of vector aguments and return types for functions called by this // function. - if (LargestVectorWidth != 0) - CurFn->addFnAttr("min-legal-vector-width", - llvm::utostr(LargestVectorWidth)); + CurFn->addFnAttr("min-legal-vector-width", llvm::utostr(LargestVectorWidth)); } /// ShouldInstrumentFunction - Return true if the current function should be diff --git a/clang/test/CodeGen/aarch64-neon-ldst-one.c b/clang/test/CodeGen/aarch64-neon-ldst-one.c index 97ded9a5966..0d20982408c 100644 --- a/clang/test/CodeGen/aarch64-neon-ldst-one.c +++ b/clang/test/CodeGen/aarch64-neon-ldst-one.c @@ -6800,4 +6800,4 @@ void test_vst4_lane_p64(poly64_t *a, poly64x1x4_t b) { // CHECK: attributes #0 ={{.*}}"min-legal-vector-width"="128" // CHECK: attributes #1 ={{.*}}"min-legal-vector-width"="64" -// CHECK-NOT: attributes #2 ={{.*}}"min-legal-vector-width" +// CHECK: attributes #2 ={{.*}}"min-legal-vector-width"="0" diff --git a/clang/test/CodeGen/aarch64-poly64.c b/clang/test/CodeGen/aarch64-poly64.c index 53493033c28..cdf91699c9b 100644 --- a/clang/test/CodeGen/aarch64-poly64.c +++ b/clang/test/CodeGen/aarch64-poly64.c @@ -614,4 +614,4 @@ poly64x2_t test_vsriq_n_p64(poly64x2_t a, poly64x2_t b) { // CHECK: attributes #0 ={{.*}}"min-legal-vector-width"="64" // CHECK: attributes #1 ={{.*}}"min-legal-vector-width"="128" -// CHECK-NOT: attributes #2 ={{.*}}"min-legal-vector-width" +// CHECK: attributes #2 ={{.*}}"min-legal-vector-width"="0" |

