From: Craig Topper Date: Mon, 19 Jun 2017 16:23:43 +0000 (+0000) Subject: [Reassociate] Make one of the helper methods static because it doesn't use any class... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b4b5aa007f59fa163e1b05a046e57d58c64c63c;p=llvm [Reassociate] Make one of the helper methods static because it doesn't use any class variables. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305703 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Transforms/Scalar/Reassociate.h b/include/llvm/Transforms/Scalar/Reassociate.h index 7b68b448930..a30a7176baa 100644 --- a/include/llvm/Transforms/Scalar/Reassociate.h +++ b/include/llvm/Transforms/Scalar/Reassociate.h @@ -82,8 +82,6 @@ private: bool CombineXorOpnd(Instruction *I, reassociate::XorOpnd *Opnd1, reassociate::XorOpnd *Opnd2, APInt &ConstOpnd, Value *&Res); - bool collectMultiplyFactors(SmallVectorImpl &Ops, - SmallVectorImpl &Factors); Value *buildMinimalMultiplyDAG(IRBuilder<> &Builder, SmallVectorImpl &Factors); Value *OptimizeMul(BinaryOperator *I, diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 4b543b6d04d..4ce32e0eca7 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -1628,8 +1628,8 @@ Value *ReassociatePass::OptimizeAdd(Instruction *I, /// ((((x*y)*x)*y)*x) -> [(x, 3), (y, 2)] /// /// \returns Whether any factors have a power greater than one. -bool ReassociatePass::collectMultiplyFactors(SmallVectorImpl &Ops, - SmallVectorImpl &Factors) { +static bool collectMultiplyFactors(SmallVectorImpl &Ops, + SmallVectorImpl &Factors) { // FIXME: Have Ops be (ValueEntry, Multiplicity) pairs, simplifying this. // Compute the sum of powers of simplifiable factors. unsigned FactorPowerSum = 0;