summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-08 19:37:20 +0000
committerChris Lattner <sabre@nondot.org>2005-01-08 19:37:20 +0000
commit47f395cd8543dee31f93f5cf94adabfd700a2bc0 (patch)
tree260b13c592b3666d7a40b9e80f738b4093f285f4 /llvm/lib/Transforms
parentce274ce93de032513f3c13aa49fa2dd9908a273b (diff)
downloadbcm5719-llvm-47f395cd8543dee31f93f5cf94adabfd700a2bc0.tar.gz
bcm5719-llvm-47f395cd8543dee31f93f5cf94adabfd700a2bc0.zip
Silence VS warnings.
llvm-svn: 19380
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnroll.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnroll.cpp b/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
index 1b807873e6a..8e625202455 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
@@ -136,21 +136,23 @@ bool LoopUnroll::visitLoop(Loop *L) {
ConstantInt *TripCountC = dyn_cast_or_null<ConstantInt>(L->getTripCount());
if (!TripCountC) return Changed; // Must have constant trip count!
- unsigned TripCount = TripCountC->getRawValue();
- if (TripCount != TripCountC->getRawValue() || TripCount == 0)
+ uint64_t TripCountFull = TripCountC->getRawValue();
+ if (TripCountFull != TripCountC->getRawValue() || TripCountFull == 0)
return Changed; // More than 2^32 iterations???
unsigned LoopSize = ApproximateLoopSize(L);
DEBUG(std::cerr << "Loop Unroll: F[" << BB->getParent()->getName()
<< "] Loop %" << BB->getName() << " Loop Size = " << LoopSize
- << " Trip Count = " << TripCount << " - ");
- uint64_t Size = (uint64_t)LoopSize*(uint64_t)TripCount;
+ << " Trip Count = " << TripCountFull << " - ");
+ uint64_t Size = (uint64_t)LoopSize*TripCountFull;
if (Size > UnrollThreshold) {
DEBUG(std::cerr << "TOO LARGE: " << Size << ">" << UnrollThreshold << "\n");
return Changed;
}
DEBUG(std::cerr << "UNROLLING!\n");
-
+
+ unsigned TripCount = (unsigned)TripCountFull;
+
BasicBlock *LoopExit = BI->getSuccessor(L->contains(BI->getSuccessor(0)));
// Create a new basic block to temporarily hold all of the cloned code.
OpenPOWER on IntegriCloud