Patchwork [Cilkplus] Remove unwanted static chain.

login
register
mail settings
Submitter Iyer, Balaji V
Date Aug. 7, 2012, 8:17 p.m.
Message ID <BF230D13CA30DD48930C31D40993300016C4E987@FMSMSX102.amr.corp.intel.com>
Download mbox | patch
Permalink /patch/175794/
State New
Headers show

Comments

Iyer, Balaji V - Aug. 7, 2012, 8:17 p.m.
Hello Everyone,
	This patch is for the Cilk Plus branch affecting mainly the C++ compiler. This patch will store the initial value of a loop correctly and remove the unnecessary static chain usage for some cases of Cilk_for.

Thanks,

Balaji V. Iyer.

Patch

Index: parser.c
===================================================================
--- parser.c	(revision 190195)
+++ parser.c	(working copy)
@@ -28351,6 +28351,13 @@ 
   FOR_EXPR (statement) = decl;
   CILK_FOR_GRAIN (statement) = grain; 
 
+  /*  If an initial value is available, and it is of type integer, then we
+      save it in CILK_FOR_INIT.  */
+  if (init && TREE_TYPE (init) && INTEGRAL_TYPE_P (TREE_TYPE (init))) 
+    CILK_FOR_INIT (statement) = init;
+  else
+    CILK_FOR_INIT (statement) = NULL_TREE;
+
   finish_cilk_for_init_stmt (statement);
 
   if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA))
Index: ChangeLog.cilk
===================================================================
--- ChangeLog.cilk	(revision 190195)
+++ ChangeLog.cilk	(working copy)
@@ -1,3 +1,7 @@ 
+2012-08-07  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+	* parser.c (cp_parser_cilk_for): Stored the initial value in cilk_for tree.
+
 2012-08-01  Balaji V. Iyer  <balaji.v.iyer@intel.com>
 
 	* parser.c (cp_parser_userdef_char_literal): Replaced CALL_SPAWN and