]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Loop unroller: do not unroll loops in which the conditional branch is
authorJulian Seward <jseward@acm.org>
Tue, 30 Nov 2004 13:40:29 +0000 (13:40 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 30 Nov 2004 13:40:29 +0000 (13:40 +0000)
not Ijk_Boring, as that will cause events that should be passed to the
caller's scheduler, not to be.

git-svn-id: svn://svn.valgrind.org/vex/trunk@600

VEX/priv/ir/iropt.c

index 4e76d65a056e3b7d3305f0b597af53f6da43804d..56073f86eb54228e12bd3cc8c93e05fa4383a1f1 100644 (file)
@@ -2968,7 +2968,8 @@ static void deltaIRStmt ( IRStmt* st, Int delta )
 /* The two schemas considered are:
 
      X: BODY; goto X
-     --> X: BODY;BODY; goto X
+
+     which unrolls to (eg)  X: BODY;BODY; goto X
 
    and
 
@@ -3086,6 +3087,8 @@ static IRBB* maybe_loop_unroll_BB ( IRBB* bb0, Addr64 my_addr )
    st = bb0->stmts[i];
    if (st->tag != Ist_Exit)
       return NULL;
+   if (st->Ist.Exit.jk != Ijk_Boring)
+      return NULL;
 
    con = st->Ist.Exit.dst;
    vassert(con->tag == Ico_U32 || con->tag == Ico_U64);