llvm-6502/include/llvm/Analysis
Wojciech Matyjewicz e3320a1bcc Fix PR1798 - an error in the evaluation of SCEVAddRecExpr at an
arbitrary iteration.

The patch:
1) changes SCEVSDivExpr into SCEVUDivExpr,
2) replaces PartialFact() function with BinomialCoefficient(); the 
computations (essentially, the division) in BinomialCoefficient() are 
performed with the apprioprate bitwidth necessary to avoid overflow; 
unsigned division is used instead of the signed one.

Computations in BinomialCoefficient() require support from the code 
generator for APInts. Currently, we use a hack rounding up the 
neccessary bitwidth to the nearest power of 2. The hack is easy to turn 
off in future.

One remaining issue: we assume the divisor of the binomial coefficient 
formula can be computed accurately using 16 bits. It means we can handle 
AddRecs of length up to 9. In future, we should use APInts to evaluate 
the divisor.

Thanks to Nicholas for cooperation!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46955 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-11 11:03:14 +00:00
..
AliasAnalysis.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
AliasSetTracker.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
CallGraph.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
CFGPrinter.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ConstantFolding.h Avoid unnecessarily casting away const, fixing a FIXME. 2008-01-31 01:05:10 +00:00
ConstantsScanner.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
DominatorInternals.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Dominators.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
FindUsedTypes.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Interval.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
IntervalIterator.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
IntervalPartition.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
LoadValueNumbering.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
LoopInfo.h Add a check if the initial value of the induction variable is 0 (the method comment says it should be). 2008-02-09 18:06:58 +00:00
LoopPass.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MemoryDependenceAnalysis.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Passes.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
PostDominators.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ProfileInfo.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ProfileInfoLoader.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ProfileInfoTypes.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ScalarEvolution.h Fix PR1798 - an error in the evaluation of SCEVAddRecExpr at an 2008-02-11 11:03:14 +00:00
ScalarEvolutionExpander.h Fix PR1798 - an error in the evaluation of SCEVAddRecExpr at an 2008-02-11 11:03:14 +00:00
ScalarEvolutionExpressions.h Fix PR1798 - an error in the evaluation of SCEVAddRecExpr at an 2008-02-11 11:03:14 +00:00
Trace.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ValueNumbering.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Verifier.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00