[InstCombine] Change helper method to a file local static method. NFC
authorCraig Topper <craig.topper@intel.com>
Thu, 6 Jul 2017 16:24:23 +0000 (16:24 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 6 Jul 2017 16:24:23 +0000 (16:24 +0000)
llvm-svn: 307275

llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/lib/Transforms/InstCombine/InstCombineInternal.h

index 7e8c2e1b4c1ddfc12533cb3c395f570b036f2cc0..99d5e3f7d028ba4e917fa69f4c0e3e2ec08b4871 100644 (file)
@@ -80,7 +80,8 @@ static Value *getFCmpValue(unsigned Code, Value *LHS, Value *RHS,
 /// \param I Binary operator to transform.
 /// \return Pointer to node that must replace the original binary operator, or
 ///         null pointer if no transformation was made.
-Value *InstCombiner::SimplifyBSwap(BinaryOperator &I) {
+static Value *SimplifyBSwap(BinaryOperator &I,
+                            InstCombiner::BuilderTy *Builder) {
   assert(I.isBitwiseLogicOp() && "Unexpected opcode for bswap simplifying");
 
   Value *OldLHS = I.getOperand(0);
@@ -1281,7 +1282,7 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) {
   if (Value *V = SimplifyUsingDistributiveLaws(I))
     return replaceInstUsesWith(I, V);
 
-  if (Value *V = SimplifyBSwap(I))
+  if (Value *V = SimplifyBSwap(I, Builder))
     return replaceInstUsesWith(I, V);
 
   if (ConstantInt *AndRHS = dyn_cast<ConstantInt>(Op1)) {
@@ -1985,7 +1986,7 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) {
   if (Value *V = SimplifyUsingDistributiveLaws(I))
     return replaceInstUsesWith(I, V);
 
-  if (Value *V = SimplifyBSwap(I))
+  if (Value *V = SimplifyBSwap(I, Builder))
     return replaceInstUsesWith(I, V);
 
   if (isa<Constant>(Op1))
@@ -2400,7 +2401,7 @@ Instruction *InstCombiner::visitXor(BinaryOperator &I) {
   if (SimplifyDemandedInstructionBits(I))
     return &I;
 
-  if (Value *V = SimplifyBSwap(I))
+  if (Value *V = SimplifyBSwap(I, Builder))
     return replaceInstUsesWith(I, V);
 
   // Apply DeMorgan's Law for 'nand' / 'nor' logic with an inverted operand.
index 87f11467b95e2ae6476f5ab6495b3b57852370e7..cb0cda3be116c89269a9f2814ab1d580c93760ee 100644 (file)
@@ -639,7 +639,6 @@ private:
                                     APInt &UndefElts, unsigned Depth = 0);
 
   Value *SimplifyVectorOp(BinaryOperator &Inst);
-  Value *SimplifyBSwap(BinaryOperator &Inst);
 
 
   /// Given a binary operator, cast instruction, or select which has a PHI node