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 | dfa39ffd088e0a66bb88239556b029ebb8fc57fc (patch) | |
tree | 212677775d2faa72ccfa823670b615978c1e6d26 | |
parent | dc94ce7a8dc76e065255b325fa1e345c32f0b85a (diff) |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345237 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 4 | ||||
-rw-r--r-- | test/CodeGen/aarch64-neon-ldst-one.c | 2 | ||||
-rw-r--r-- | test/CodeGen/aarch64-poly64.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 41bde79aba..700723189e 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/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/test/CodeGen/aarch64-neon-ldst-one.c b/test/CodeGen/aarch64-neon-ldst-one.c index 97ded9a596..0d20982408 100644 --- a/test/CodeGen/aarch64-neon-ldst-one.c +++ b/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/test/CodeGen/aarch64-poly64.c b/test/CodeGen/aarch64-poly64.c index 53493033c2..cdf91699c9 100644 --- a/test/CodeGen/aarch64-poly64.c +++ b/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" |