1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/Analysis
Wojciech Matyjewicz 76c2b22ee4 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!

llvm-svn: 46955
2008-02-11 11:03:14 +00:00
..
Andersens Create nodes for inline asm so that we don't crash looking for the node later. 2007-11-22 03:07:37 +00:00
BasicAA Teach basicaa that 'byval' arguments define a new memory location that 2008-01-24 18:00:32 +00:00
Dominators update for new domtree dump format 2007-08-06 06:17:08 +00:00
GlobalsModRef Ding dong, the DoesntAccessMemoryFns and 2007-11-23 19:30:27 +00:00
LoadVN Ding dong, the DoesntAccessMemoryFns and 2007-11-23 19:30:27 +00:00
LoopInfo Convert .cvsignore files 2007-06-29 16:35:07 +00:00
ScalarEvolution Fix PR1798 - an error in the evaluation of SCEVAddRecExpr at an 2008-02-11 11:03:14 +00:00