From 2311dcd08d74f908619c652faf2e127ec4710b48 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 26 Feb 2005 23:36:45 +0000 Subject: [PATCH] DCE a dead function llvm-svn: 20339 --- lib/Analysis/ScalarEvolution.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index d2331ba3386..744d6581c52 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -495,25 +495,6 @@ static SCEVHandle getMinusSCEV(const SCEVHandle &LHS, const SCEVHandle &RHS) { } -/// Binomial - Evaluate N!/((N-M)!*M!) . Note that N is often large and M is -/// often very small, so we try to reduce the number of N! terms we need to -/// evaluate by evaluating this as (N!/(N-M)!)/M! -static ConstantInt *Binomial(ConstantInt *N, unsigned M) { - uint64_t NVal = N->getRawValue(); - uint64_t FirstTerm = 1; - for (unsigned i = 0; i != M; ++i) - FirstTerm *= NVal-i; - - unsigned MFactorial = 1; - for (; M; --M) - MFactorial *= M; - - Constant *Result = ConstantUInt::get(Type::ULongTy, FirstTerm/MFactorial); - Result = ConstantExpr::getCast(Result, N->getType()); - assert(isa(Result) && "Cast of integer not folded??"); - return cast(Result); -} - /// PartialFact - Compute V!/(V-NumSteps)! static SCEVHandle PartialFact(SCEVHandle V, unsigned NumSteps) { // Handle this case efficiently, it is common to have constant iteration