llvm-6502/lib/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
..
IPA Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
AliasAnalysis.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
AliasAnalysisCounter.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
AliasAnalysisEvaluator.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
AliasDebugger.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
AliasSetTracker.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Analysis.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
BasicAliasAnalysis.cpp getUnderlyingObject can return null, handle this. 2008-01-24 19:07:10 +00:00
CFGPrinter.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
ConstantFolding.cpp Avoid unnecessarily casting away const, fixing a FIXME. 2008-01-31 01:05:10 +00:00
InstCount.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Interval.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
IntervalPartition.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
LoadValueNumbering.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
LoopInfo.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
LoopPass.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Makefile remove attribution from lib Makefiles. 2007-12-29 20:09:26 +00:00
MemoryDependenceAnalysis.cpp Throttle the non-local dependence analysis for basic blocks with more than 50 predecessors. Added command line option to play with this threshold. 2008-02-06 00:54:55 +00:00
PostDominators.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
ProfileInfo.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
ProfileInfoLoader.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
ProfileInfoLoaderPass.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
ScalarEvolution.cpp Fix PR1798 - an error in the evaluation of SCEVAddRecExpr at an 2008-02-11 11:03:14 +00:00
ScalarEvolutionExpander.cpp We should check that existing cast operation has the appropriate opcode before we reuse it. 2008-02-09 18:30:13 +00:00
Trace.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
ValueNumbering.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00