aboutsummaryrefslogtreecommitdiff
path: root/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
commit23300aa3e387ffd7e478804568c3754f59df7942 (patch)
tree9d20de014007756a938c1310c27fd2304fb95d29 /lib/Transforms/Scalar/LoopUnroll.cpp
parentb306e38a2e00eccb2b6cca176ce71385fb4a77f9 (diff)
Adjust loop size estimate for full unrolling;
GEP's don't usually become instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopUnroll.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopUnroll.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp
index 2025fb6828..23757cdb2d 100644
--- a/lib/Transforms/Scalar/LoopUnroll.cpp
+++ b/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