llvm.org GIT mirror llvm / 402c6d7
Back out r62958 from the release branch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_25@63791 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 11 years ago
1 changed file(s) with 11 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
584584 }
585585
586586 // We need at least W + T bits for the multiplication step
587 unsigned CalculationBits = W + T;
587 // FIXME: A temporary hack; we round up the bitwidths
588 // to the nearest power of 2 to be nice to the code generator.
589 unsigned CalculationBits = 1U << Log2_32_Ceil(W + T);
590 // FIXME: Temporary hack to avoid generating integers that are too wide.
591 // Although, it's not completely clear how to determine how much
592 // widening is safe; for example, on X86, we can't really widen
593 // beyond 64 because we need to be able to do multiplication
594 // that's CalculationBits wide, but on X86-64, we can safely widen up to
595 // 128 bits.
596 if (CalculationBits > 64)
597 return new SCEVCouldNotCompute();
588598
589599 // Calcuate 2^T, at width T+W.
590600 APInt DivFactor = APInt(CalculationBits, 1).shl(T);