[PATCH] Improve isPotentiallyReachable

Andrew Trick atrick at apple.com
Fri Aug 9 00:51:01 PDT 2013


  This looks ok in the case of no LoopInfo.

  The LoopInfo case looks wrong to begin with, and your patch could result in more linear scans. For instructions in the same block, why don't we do the loop check first:

      if (LI && LI->getLoopFor(BB))
        return true;
    // else fall through to the linear scan followed by path exploration
    // just like the non-loopinfo case.

  The current code skips the path exploration if we're not in a loop! I don't understand how this is correct in the presence of irreducible control flow.

http://llvm-reviews.chandlerc.com/D1247



More information about the llvm-commits mailing list