1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
llvm-mirror/lib/Analysis
Chris Lattner 9a73de2ba2 Add the ability to compute trip counts that are only controlled by constants
even if the loop is using expressions that we can't compute as a closed-form.
This allows us to calculate that this function always returns 55:

int test() {
  double X;
  int Count = 0;
  for (X = 100; X > 1; X = sqrt(X), ++Count)
    /*empty*/;
  return Count;
}

And allows us to compute trip counts for loops like:

        int h = 1;
         do h = 3 * h + 1; while (h <= 256);

(which occurs in bzip2), and for this function, which occurs after inlining
and other optimizations:

int popcount()
{
   int x = 666;
  int result = 0;
  while (x != 0) {
    result = result + (x & 0x1);
    x = x >> 1;
  }
  return result;
}

We still cannot compute the exit values of result or h in the two loops above,
which means we cannot delete the loop, but we are getting closer.  Being able to
compute a constant trip count for these two loops will allow us to unroll them
completely though.

llvm-svn: 13017
2004-04-17 18:36:24 +00:00
..
DataStructure Support getelementptr instructions which use uint's to index into structure 2004-04-05 01:30:19 +00:00
IPA Change the call graph class to have TWO external nodes, making call graph 2004-04-12 05:36:32 +00:00
AliasAnalysis.cpp Deinline some virtual methods, provide better mod/ref answers through the 2004-03-15 04:07:29 +00:00
AliasAnalysisCounter.cpp Pass through the boolean queries 2004-03-15 04:06:46 +00:00
AliasAnalysisEvaluator.cpp Simplify code to process CallSites (thanks to Chris). 2004-03-12 16:20:49 +00:00
AliasSetTracker.cpp Fix a HORRIBLY NASTY bug that caused siod to stop working last night. 2004-03-17 23:22:04 +00:00
BasicAliasAnalysis.cpp Hrm, operator new and new[] do not belong here. We should not CSE them! :) 2004-04-12 05:16:42 +00:00
CFGPrinter.cpp Finegrainify namespacification 2003-12-11 21:48:18 +00:00
Expressions.cpp Remove use of ConstantHandling itf 2004-01-12 18:02:15 +00:00
InstCount.cpp Put all LLVM code into the llvm namespace, as per bug 109. 2003-11-11 22:41:34 +00:00
Interval.cpp Put all LLVM code into the llvm namespace, as per bug 109. 2003-11-11 22:41:34 +00:00
IntervalPartition.cpp Put all LLVM code into the llvm namespace, as per bug 109. 2003-11-11 22:41:34 +00:00
LoadValueNumbering.cpp Implement test/Regression/Transforms/GCSE/undefined_load.ll 2004-04-03 00:45:16 +00:00
LoopInfo.cpp add some helpful methods. Rearrange #includes to proper order 2004-04-15 15:16:02 +00:00
Makefile Live var is now in lib/Target/Sparc 2004-01-09 18:16:20 +00:00
PostDominators.cpp Finegrainify namespacification 2003-12-07 00:35:42 +00:00
PrintSCC.cpp Put all LLVM code into the llvm namespace, as per bug 109. 2003-11-11 22:41:34 +00:00
ProfileInfo.cpp Switch to using edge profiling information as the basic source of profile info 2004-03-08 22:04:08 +00:00
ProfileInfoLoader.cpp If we have edge counts, we can produce block counts. I've verified that 2004-03-08 20:03:52 +00:00
ProfileInfoLoaderPass.cpp Switch to using edge profiling information as the basic source of profile info 2004-03-08 22:04:08 +00:00
ScalarEvolution.cpp Add the ability to compute trip counts that are only controlled by constants 2004-04-17 18:36:24 +00:00
Trace.cpp Import the trace class from the reoptimizer 2004-03-08 20:57:27 +00:00
ValueNumbering.cpp Minor efficiency improvement, finegrainify namespacification 2004-03-25 22:56:03 +00:00