[LLVMbugs] [Bug 14794] New: Request a conservative reachability analysis for CapturesBefore

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jan 4 11:20:47 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=14794

             Bug #: 14794
           Summary: Request a conservative reachability analysis for
                    CapturesBefore
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Global Analyses
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: mren at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


More discussions at
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121224/160534.html

We currently have a simple helper function (r=171512)
+  // Conservatively return true. Return false, if there is a single path
+  // starting from "From" and the path does not reach "To".
+  static bool hasPath(const BasicBlock *From, const BasicBlock *To) {
+    const unsigned MaxCheck = 5;
+    const BasicBlock *Current = From;
+    for (unsigned I = 0; I < MaxCheck; I++) {
+      unsigned NumSuccs = Current->getTerminator()->getNumSuccessors();
+      if (NumSuccs > 1)
+        return true;
+      if (NumSuccs == 0)
+        return false;
+      Current = Current->getTerminator()->getSuccessor(0);
+      if (Current == To)
+        return true;
+    }
+    return true;
+  }

This is too conservative, for performance, we should try to improve the
accuracy.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list