This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)


On 08/07/2017 05:08 AM, Jakub Jelinek wrote:
+		  tree s = lookup_attribute ("omp declare simd",
+					     DECL_ATTRIBUTES (newdecl));
+		  if (s)
+		    {
+		      tree b
+			= builtin_decl_explicit (DECL_FUNCTION_CODE (newdecl));
+		      if (b)
+			{
+			  tree s2 = lookup_attribute ("omp declare simd",
+						      DECL_ATTRIBUTES (b));
+			  while (s)
+			    {
+			      tree s3;
+			      for (s3 = s2; s3;
+				   s3 = lookup_attribute ("omp declare simd",
+							  TREE_CHAIN (s3)))
+				if (attribute_value_equal (s, s3))
+				  break;
+			      if (!s3)
+				{
+				  s3 = copy_node (s);
+				  TREE_CHAIN (s3) = DECL_ATTRIBUTES (b);
+				  DECL_ATTRIBUTES (b) = s3;
+				}
+			      s = lookup_attribute ("omp declare simd",
+						    TREE_CHAIN (s));
+			    }
+			}
+		    }

This should really be a separate function.  Perhaps "merge_one_attribute"?

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]