From 031b1bc06ff6e3145abf2e81f6e413904b0fb1d0 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Wed, 3 Aug 2016 19:13:50 +0000 Subject: [PATCH] Pass EphValues by const-ref as it is not modified in the callee Patch by Aditya Kumar. Differential Revision: https://reviews.llvm.org/D22967 llvm-svn: 277634 --- llvm/include/llvm/Analysis/CodeMetrics.h | 2 +- llvm/lib/Analysis/CodeMetrics.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/Analysis/CodeMetrics.h b/llvm/include/llvm/Analysis/CodeMetrics.h index f512aca..9e861ac 100644 --- a/llvm/include/llvm/Analysis/CodeMetrics.h +++ b/llvm/include/llvm/Analysis/CodeMetrics.h @@ -87,7 +87,7 @@ struct CodeMetrics { /// \brief Add information about a block to the current state. void analyzeBasicBlock(const BasicBlock *BB, const TargetTransformInfo &TTI, - SmallPtrSetImpl &EphValues); + const SmallPtrSetImpl &EphValues); /// \brief Collect a loop's ephemeral values (those used only by an assume /// or similar intrinsics in the loop). diff --git a/llvm/lib/Analysis/CodeMetrics.cpp b/llvm/lib/Analysis/CodeMetrics.cpp index ed83704..576dca4 100644 --- a/llvm/lib/Analysis/CodeMetrics.cpp +++ b/llvm/lib/Analysis/CodeMetrics.cpp @@ -104,7 +104,7 @@ void CodeMetrics::collectEphemeralValues( /// block. void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB, const TargetTransformInfo &TTI, - SmallPtrSetImpl &EphValues) { + const SmallPtrSetImpl &EphValues) { ++NumBlocks; unsigned NumInstsBeforeThisBB = NumInsts; for (const Instruction &I : *BB) { -- 2.7.4