This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] Cleanup and improvement of if-conversion for vectorization


On Sat, 29 May 2010, Sebastian Pop wrote:

> On Thu, May 27, 2010 at 04:48, Richard Guenther <rguenther@suse.de> wrote:
> > On Wed, 26 May 2010, Sebastian Pop wrote:
> >
> >> On Wed, May 26, 2010 at 04:19, Richard Guenther <rguenther@suse.de> wrote:
> >> > I still do not at all understand #3 and #4. ?Please explain.
> >>
> >> 0002-Predicate-all-the-memory-writes.patch
> >> 0003-Fix-creation-of-temp-variables.patch
> >>
> >> Before #2 the only variables that were created by the if-conversion
> >> pass were scalar SSA names. ?#2 allows reads and writes to memory.
> >
> > What do you mean? ?In
> >
> >> D.2757_29 != 0 ? _ifc_.11 : _ifc_.12;
> >
> > I see non-SSA names _ifc_.11 and _ifc_.12 - that is not valid gimple.
> >
> > Neither would a COND_EXPR RHS with a memory store on the LHS be
> > valid gimple. ?I suppose I have to fix the verifier to barf on you
> > here.
> >
> > A COND_EXPR RHS is not a memory load, so the statement should never
> > get a VOP and thus the alias-oracle need not to care about it.
> 
> Ok, please fix verify_ssa ().

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2010-05-30  Richard Guenther  <rguenther@suse.de>

	* tree-cfg.c (verify_gimple_assign_single): Implement
	verification for COND_EXPR rhs.

Index: gcc/tree-cfg.c
===================================================================
--- gcc/tree-cfg.c	(revision 159966)
+++ gcc/tree-cfg.c	(working copy)
@@ -3608,6 +3677,20 @@ verify_gimple_assign_single (gimple stmt
       return res;
 
     case COND_EXPR:
+      if (!is_gimple_reg (lhs)
+	  || (!is_gimple_reg (TREE_OPERAND (rhs1, 0))
+	      && !COMPARISON_CLASS_P (TREE_OPERAND (rhs1, 0)))
+	  || (!is_gimple_reg (TREE_OPERAND (rhs1, 1))
+	      && !is_gimple_min_invariant (TREE_OPERAND (rhs1, 1)))
+	  || (!is_gimple_reg (TREE_OPERAND (rhs1, 2))
+	      && !is_gimple_min_invariant (TREE_OPERAND (rhs1, 2))))
+	{
+	  error ("invalid COND_EXPR in gimple assignment");
+	  debug_generic_stmt (rhs1);
+	  return true;
+	}
+      return res;
+
     case CONSTRUCTOR:
     case OBJ_TYPE_REF:
     case ASSERT_EXPR:

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