From: Dale Johannesen Date: Mon, 20 Apr 2009 22:19:33 +0000 (+0000) Subject: Adjust loop size estimate for full unrolling; X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=23300aa3e387ffd7e478804568c3754f59df7942;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp index 2025fb68288..23757cdb2d2 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(I)) { // Ignore debug instructions + } else if (isa(I) && I->hasOneUse()) { + // Ignore GEP as they generally are subsumed into a load or store. } else if (isa(I)) { // Estimate size overhead introduced by call instructions which // is higher than other instructions. Here 3 and 10 are magic