summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-04-20 22:19:33 +0000
committerDale Johannesen <dalej@apple.com>2009-04-20 22:19:33 +0000
commit12382204739184025a60000298bf78be7ed90830 (patch)
treee84764b2f6f9838d85112b4038d86a9632df32c0 /llvm/lib/Transforms/Scalar/LoopUnroll.cpp
parent40c52322a736a2950e711c8bbf536644860fe193 (diff)
downloadbcm5719-llvm-12382204739184025a60000298bf78be7ed90830.tar.gz
bcm5719-llvm-12382204739184025a60000298bf78be7ed90830.zip
Adjust loop size estimate for full unrolling;
GEP's don't usually become instructions. llvm-svn: 69631
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnroll.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnroll.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnroll.cpp b/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
index 2025fb68288..23757cdb2d2 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
@@ -89,6 +89,8 @@ static unsigned ApproximateLoopSize(const Loop *L) {
// Ignore instructions only used by the loop terminator.
} else if (isa<DbgInfoIntrinsic>(I)) {
// Ignore debug instructions
+ } else if (isa<GetElementPtrInst>(I) && I->hasOneUse()) {
+ // Ignore GEP as they generally are subsumed into a load or store.
} else if (isa<CallInst>(I)) {
// Estimate size overhead introduced by call instructions which
// is higher than other instructions. Here 3 and 10 are magic
OpenPOWER on IntegriCloud