[llvm] ebd5a1b - [Reassociate] Use IRBuilderBase; NFC

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 4 03:35:09 PDT 2020


Author: Nikita Popov
Date: 2020-04-04T12:34:16+02:00
New Revision: ebd5a1b0498ff0c7cf790f6d980db5a8a3e2bbb9

URL: https://github.com/llvm/llvm-project/commit/ebd5a1b0498ff0c7cf790f6d980db5a8a3e2bbb9
DIFF: https://github.com/llvm/llvm-project/commit/ebd5a1b0498ff0c7cf790f6d980db5a8a3e2bbb9.diff

LOG: [Reassociate] Use IRBuilderBase; NFC

And remove now unnecessary IRBuilder.h include in header.

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/Scalar/Reassociate.h
    llvm/lib/Transforms/Scalar/Reassociate.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/Scalar/Reassociate.h b/llvm/include/llvm/Transforms/Scalar/Reassociate.h
index d5b175eff0e6..28794d27325a 100644
--- a/llvm/include/llvm/Transforms/Scalar/Reassociate.h
+++ b/llvm/include/llvm/Transforms/Scalar/Reassociate.h
@@ -25,7 +25,6 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/PostOrderIterator.h"
 #include "llvm/ADT/SetVector.h"
-#include "llvm/IR/IRBuilder.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
 #include <deque>
@@ -37,6 +36,7 @@ class BasicBlock;
 class BinaryOperator;
 class Function;
 class Instruction;
+class IRBuilderBase;
 class Value;
 
 /// A private "module" namespace for types and utilities used by Reassociate.
@@ -114,7 +114,7 @@ class ReassociatePass : public PassInfoMixin<ReassociatePass> {
   bool CombineXorOpnd(Instruction *I, reassociate::XorOpnd *Opnd1,
                       reassociate::XorOpnd *Opnd2, APInt &ConstOpnd,
                       Value *&Res);
-  Value *buildMinimalMultiplyDAG(IRBuilder<> &Builder,
+  Value *buildMinimalMultiplyDAG(IRBuilderBase &Builder,
                                  SmallVectorImpl<reassociate::Factor> &Factors);
   Value *OptimizeMul(BinaryOperator *I,
                      SmallVectorImpl<reassociate::ValueEntry> &Ops);

diff  --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp
index 6fd0021adde9..8b4e36a85132 100644
--- a/llvm/lib/Transforms/Scalar/Reassociate.cpp
+++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp
@@ -1721,7 +1721,7 @@ static bool collectMultiplyFactors(SmallVectorImpl<ValueEntry> &Ops,
 }
 
 /// Build a tree of multiplies, computing the product of Ops.
-static Value *buildMultiplyTree(IRBuilder<> &Builder,
+static Value *buildMultiplyTree(IRBuilderBase &Builder,
                                 SmallVectorImpl<Value*> &Ops) {
   if (Ops.size() == 1)
     return Ops.back();
@@ -1744,7 +1744,7 @@ static Value *buildMultiplyTree(IRBuilder<> &Builder,
 /// DAG of multiplies to compute the final product, and return that product
 /// value.
 Value *
-ReassociatePass::buildMinimalMultiplyDAG(IRBuilder<> &Builder,
+ReassociatePass::buildMinimalMultiplyDAG(IRBuilderBase &Builder,
                                          SmallVectorImpl<Factor> &Factors) {
   assert(Factors[0].Power);
   SmallVector<Value *, 4> OuterProduct;


        


More information about the llvm-commits mailing list