Hi JianXin,

  Thanks for the review comments. I have attached the revised patch with these 
changes. Let me know if it is fine.

Regards,
Shivaram


From: Jian-Xin Lai [mailto:laij...@gmail.com]
Sent: Thursday, September 08, 2011 7:25 AM
To: Rao, Shivarama
Cc: open64-devel
Subject: Re: [Open64-devel] Code review request (CG)

Also, it's better to move the definition of arcs close to its uses.
2011/9/8 Jian-Xin Lai <laij...@gmail.com<mailto:laij...@gmail.com>>
Hi Shivaram,

The true_arcs and ops are defined but never used. Could you please check that?
2011/8/24 Rao, Shivarama <shivarama....@amd.com<mailto:shivarama....@amd.com>>
Hi,

Could a gatekeeper please review  the attached patch.

This patch fixes a  problem in load folding optimization where the memory 
location used in the load operation
is overwritten by a store operation. A check is added to prevent folding of 
such load operations.

The test-case and the patch is attached with the mail.

Regards,

Shivaram
AMD Open Source Compiler Engineering

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net<mailto:Open64-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/open64-devel



--
Regards,
Lai Jian-Xin



--
Regards,
Lai Jian-Xin
Index: be/cg/x8664/ebo_special.cxx
===================================================================
--- be/cg/x8664/ebo_special.cxx (revision 3725)
+++ be/cg/x8664/ebo_special.cxx (working copy)
@@ -10983,7 +10983,42 @@
       return FALSE;
     if (index_loc >= 0 && !Pred_Opnd_Avail(op, loaded_tn_info, index_loc))
       return FALSE;
+    // for this bb, obtain the dependence graph so that we can
+    // walk this op's expression tree to check dependencies.
+    // Make sure that load operand is not overwritten
+    // by a store operation before op using this dependency graph.

+    CG_DEP_Compute_Graph ( op->bb,
+                         NO_ASSIGNED_REG_DEPS,
+                         NON_CYCLIC,
+                         NO_MEMREAD_ARCS,
+                         INCLUDE_MEMIN_ARCS,
+                         NO_CONTROL_ARCS,
+                         NULL);
+
+
+    const INT hash_value = EBO_hash_op( load, NULL );
+    EBO_OP_INFO* opinfo = EBO_opinfo_table[hash_value];
+
+    while( opinfo != NULL ) {
+      OP* next_op = opinfo->in_op;
+      if( next_op == load ) break;
+      if( next_op && OP_store( next_op ) ) {
+        ARC_LIST  *arcs;
+        for (arcs = OP_succs(load); arcs != NULL; arcs = ARC_LIST_rest(arcs)) {
+           ARC *arc = ARC_LIST_first(arcs);
+           if (ARC_kind(arc) != CG_DEP_MEMANTI) continue;
+           OP *succ_op = ARC_succ(arc);
+           if ((succ_op == next_op)  && OP_Precedes(next_op, op))  {
+              CG_DEP_Delete_Graph (op->bb);
+              return FALSE;
+            }
+         }
+      }
+      opinfo = opinfo->same;
+    }
+    CG_DEP_Delete_Graph (op->bb);
+
     TOP topcode;
     if (base && offset && index && scale) {
       new_op = Mk_OP (TOP_fmovddupxx,
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to