summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-09-30 18:30:04 +0000
committerDehao Chen <dehao@google.com>2016-09-30 18:30:04 +0000
commit977853b7c52bd2e05ec9150513c509edc831c9c6 (patch)
treebceeba0f26f0d97c11f12ed66bd4c170e0dfb722 /llvm/lib
parent4b0c5aea7856eacf0e309360a3e72cf96cf602e9 (diff)
downloadbcm5719-llvm-977853b7c52bd2e05ec9150513c509edc831c9c6.tar.gz
bcm5719-llvm-977853b7c52bd2e05ec9150513c509edc831c9c6.zip
Update loop unroller cost model to make sure debug info does not affect optimization decisions.
Summary: Debug info should *not* affect optimization decisions. This patch updates loop unroller cost model to make it not affected by debug info. Reviewers: davidxl, mzolotukhin Subscribers: haicheng, llvm-commits, mzolotukhin Differential Revision: https://reviews.llvm.org/D25098 llvm-svn: 282894
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index ab8c7b664cf..5ab61f1c97e 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -411,6 +411,9 @@ analyzeLoopUnrollCost(const Loop *L, unsigned TripCount, DominatorTree &DT,
// it. We don't change the actual IR, just count optimization
// opportunities.
for (Instruction &I : *BB) {
+ if (isa<DbgInfoIntrinsic>(I))
+ continue;
+
// Track this instruction's expected baseline cost when executing the
// rolled loop form.
RolledDynamicCost += TTI.getUserCost(&I);
OpenPOWER on IntegriCloud