summaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
authorWojciech Matyjewicz <wmatyjewicz@fastmail.fm>2008-02-11 11:03:14 +0000
committerWojciech Matyjewicz <wmatyjewicz@fastmail.fm>2008-02-11 11:03:14 +0000
commite3320a1bcce3f6653e109cc86ee1011b0a61d808 (patch)
treed8b9dcd1bb0c33971010831918d5ceea70112e1e /test/Analysis
parent0753fc1850a1ca4d17acca854d830d67737fd623 (diff)
downloadllvm-e3320a1bcce3f6653e109cc86ee1011b0a61d808.tar.gz
llvm-e3320a1bcce3f6653e109cc86ee1011b0a61d808.tar.bz2
llvm-e3320a1bcce3f6653e109cc86ee1011b0a61d808.tar.xz
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
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll1
1 files changed, 0 insertions, 1 deletions
diff --git a/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll b/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
index 1bb6a20c54..66ca7551c2 100644
--- a/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
+++ b/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
@@ -1,6 +1,5 @@
; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep printd | grep 1206807378
; PR1798
-; XFAIL: *
declare void @printd(i32)