diff options
author | River Riddle <riverriddle@google.com> | 2019-07-01 10:29:09 -0700 |
---|---|---|
committer | jpienaar <jpienaar@google.com> | 2019-07-01 11:39:00 -0700 |
commit | 54cd6a7e97a226738e2c85b86559918dd9e3cd5d (patch) | |
tree | affa803347d6695be575137d1ad55a055a8021e3 /mlir/lib/Transforms/MaterializeVectors.cpp | |
parent | 84bd67fc4fd116e80f7a66bfadfe9a7fd6fd5e82 (diff) | |
download | bcm5719-llvm-54cd6a7e97a226738e2c85b86559918dd9e3cd5d.tar.gz bcm5719-llvm-54cd6a7e97a226738e2c85b86559918dd9e3cd5d.zip |
NFC: Refactor Function to be value typed.
Move the data members out of Function and into a new impl storage class 'FunctionStorage'. This allows for Function to become value typed, which will greatly simplify the transition of Function to FuncOp(given that FuncOp is also value typed).
PiperOrigin-RevId: 255983022
Diffstat (limited to 'mlir/lib/Transforms/MaterializeVectors.cpp')
-rw-r--r-- | mlir/lib/Transforms/MaterializeVectors.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mlir/lib/Transforms/MaterializeVectors.cpp b/mlir/lib/Transforms/MaterializeVectors.cpp index cd92198ac04..f59f1006ec5 100644 --- a/mlir/lib/Transforms/MaterializeVectors.cpp +++ b/mlir/lib/Transforms/MaterializeVectors.cpp @@ -636,7 +636,7 @@ static bool emitSlice(MaterializationState *state, } LLVM_DEBUG(dbgs() << "\nMLFunction is now\n"); - LLVM_DEBUG((*slice)[0]->getFunction()->print(dbgs())); + LLVM_DEBUG((*slice)[0]->getFunction().print(dbgs())); // slice are topologically sorted, we can just erase them in reverse // order. Reverse iterator does not just work simply with an operator* @@ -667,7 +667,7 @@ static bool emitSlice(MaterializationState *state, /// because we currently disallow vectorization of defs that come from another /// scope. /// TODO(ntv): please document return value. -static bool materialize(Function *f, const SetVector<Operation *> &terminators, +static bool materialize(Function f, const SetVector<Operation *> &terminators, MaterializationState *state) { DenseSet<Operation *> seen; DominanceInfo domInfo(f); @@ -721,7 +721,7 @@ static bool materialize(Function *f, const SetVector<Operation *> &terminators, return true; } LLVM_DEBUG(dbgs() << "\nMLFunction is now\n"); - LLVM_DEBUG(f->print(dbgs())); + LLVM_DEBUG(f.print(dbgs())); } return false; } @@ -731,13 +731,13 @@ void MaterializeVectorsPass::runOnFunction() { NestedPatternContext mlContext; // TODO(ntv): Check to see if this supports arbitrary top-level code. - Function *f = &getFunction(); - if (f->getBlocks().size() != 1) + Function f = getFunction(); + if (f.getBlocks().size() != 1) return; using matcher::Op; LLVM_DEBUG(dbgs() << "\nMaterializeVectors on Function\n"); - LLVM_DEBUG(f->print(dbgs())); + LLVM_DEBUG(f.print(dbgs())); MaterializationState state(hwVectorSize); // Get the hardware vector type. |