r345237 - [CodeGen] Always emit the 'min-legal-vector-width' attribute even when the value is 0.

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 24 22:04:35 PDT 2018


Author: ctopper
Date: Wed Oct 24 22:04:35 2018
New Revision: 345237

URL: http://llvm.org/viewvc/llvm-project?rev=345237&view=rev
Log:
[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.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/test/CodeGen/aarch64-neon-ldst-one.c
    cfe/trunk/test/CodeGen/aarch64-poly64.c

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=345237&r1=345236&r2=345237&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Wed Oct 24 22:04:35 2018
@@ -448,9 +448,7 @@ void CodeGenFunction::FinishFunction(Sou
   // 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

Modified: cfe/trunk/test/CodeGen/aarch64-neon-ldst-one.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/aarch64-neon-ldst-one.c?rev=345237&r1=345236&r2=345237&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/aarch64-neon-ldst-one.c (original)
+++ cfe/trunk/test/CodeGen/aarch64-neon-ldst-one.c Wed Oct 24 22:04:35 2018
@@ -6800,4 +6800,4 @@ void test_vst4_lane_p64(poly64_t  *a, po
 
 // 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"

Modified: cfe/trunk/test/CodeGen/aarch64-poly64.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/aarch64-poly64.c?rev=345237&r1=345236&r2=345237&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/aarch64-poly64.c (original)
+++ cfe/trunk/test/CodeGen/aarch64-poly64.c Wed Oct 24 22:04:35 2018
@@ -614,4 +614,4 @@ poly64x2_t test_vsriq_n_p64(poly64x2_t a
 
 // 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"




More information about the cfe-commits mailing list