[llvm] r277634 - Pass EphValues by const-ref as it is not modified in the callee

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 12:13:50 PDT 2016


Author: spop
Date: Wed Aug  3 14:13:50 2016
New Revision: 277634

URL: http://llvm.org/viewvc/llvm-project?rev=277634&view=rev
Log:
Pass EphValues by const-ref as it is not modified in the callee

Patch by Aditya Kumar.

Differential Revision: https://reviews.llvm.org/D22967

Modified:
    llvm/trunk/include/llvm/Analysis/CodeMetrics.h
    llvm/trunk/lib/Analysis/CodeMetrics.cpp

Modified: llvm/trunk/include/llvm/Analysis/CodeMetrics.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CodeMetrics.h?rev=277634&r1=277633&r2=277634&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/CodeMetrics.h (original)
+++ llvm/trunk/include/llvm/Analysis/CodeMetrics.h Wed Aug  3 14:13:50 2016
@@ -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<const Value*> &EphValues);
+                         const SmallPtrSetImpl<const Value*> &EphValues);
 
   /// \brief Collect a loop's ephemeral values (those used only by an assume
   /// or similar intrinsics in the loop).

Modified: llvm/trunk/lib/Analysis/CodeMetrics.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CodeMetrics.cpp?rev=277634&r1=277633&r2=277634&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CodeMetrics.cpp (original)
+++ llvm/trunk/lib/Analysis/CodeMetrics.cpp Wed Aug  3 14:13:50 2016
@@ -104,7 +104,7 @@ void CodeMetrics::collectEphemeralValues
 /// block.
 void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB,
                                     const TargetTransformInfo &TTI,
-                                    SmallPtrSetImpl<const Value*> &EphValues) {
+                                    const SmallPtrSetImpl<const Value*> &EphValues) {
   ++NumBlocks;
   unsigned NumInstsBeforeThisBB = NumInsts;
   for (const Instruction &I : *BB) {




More information about the llvm-commits mailing list