]> granicus.if.org Git - clang/commitdiff
[CodeGen] Always emit the 'min-legal-vector-width' attribute even when the value...
authorCraig Topper <craig.topper@intel.com>
Thu, 25 Oct 2018 05:04:35 +0000 (05:04 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 25 Oct 2018 05:04:35 +0000 (05:04 +0000)
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

lib/CodeGen/CodeGenFunction.cpp
test/CodeGen/aarch64-neon-ldst-one.c
test/CodeGen/aarch64-poly64.c

index 41bde79abab3518cdd15a20623ae3eaf292d1de3..700723189ed189207c1a710377fb17856eeb6b6d 100644 (file)
@@ -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
index 97ded9a596666072b34a4bf8c1889b9a16447372..0d20982408cfdb9890a0386ed8f628adb7c7a0f4 100644 (file)
@@ -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"
index 53493033c286f6ce5289fa1ecb61a7c2df0dc472..cdf91699c9b0c0f88955c066149418a8de41276e 100644 (file)
@@ -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"