Bail out the LiveVariables analysis when the CFG is very large, as

we are encountering some scalability issues with memory usage.   The
appropriate long term fix is to make the analysis more scalable, but
this will at least prevent the analyzer swapping when
analyzing very large functions.

llvm-svn: 159578
This commit is contained in:
Ted Kremenek
2012-07-02 20:21:52 +00:00
parent 146ef384da
commit de21a1c964
3 changed files with 15 additions and 0 deletions

View File

@@ -486,6 +486,11 @@ LiveVariables::computeLiveness(AnalysisDeclContext &AC,
if (!cfg)
return 0;
// The analysis currently has scalability issues for very large CFGs.
// Bail out if it looks too large.
if (cfg->getNumBlockIDs() > 300000)
return 0;
LiveVariablesImpl *LV = new LiveVariablesImpl(AC, killAtAssign);
// Construct the dataflow worklist. Enqueue the exit block as the