From 2bdf33cc4c733342fc83081bc7410ac5e9a24f55 Mon Sep 17 00:00:00 2001 From: River Riddle Date: Sat, 11 Jan 2020 08:54:04 -0800 Subject: [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is properly value-typed. Summary: These were temporary methods used to simplify the transition. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D72548 --- mlir/lib/Transforms/Vectorize.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'mlir/lib/Transforms/Vectorize.cpp') diff --git a/mlir/lib/Transforms/Vectorize.cpp b/mlir/lib/Transforms/Vectorize.cpp index 6b2b3e1ee7e..fb10ed94062 100644 --- a/mlir/lib/Transforms/Vectorize.cpp +++ b/mlir/lib/Transforms/Vectorize.cpp @@ -797,7 +797,7 @@ template static LogicalResult vectorizeRootOrTerminal(Value iv, LoadOrStoreOpPointer memoryOp, VectorizationState *state) { - auto memRefType = memoryOp.getMemRef()->getType().template cast(); + auto memRefType = memoryOp.getMemRef().getType().template cast(); auto elementType = memRefType.getElementType(); // TODO(ntv): ponder whether we want to further vectorize a vector value. @@ -981,10 +981,9 @@ static Value vectorizeConstant(Operation *op, ConstantOp constant, Type type) { /// TODO(ntv): handle more complex cases. static Value vectorizeOperand(Value operand, Operation *op, VectorizationState *state) { - LLVM_DEBUG(dbgs() << "\n[early-vect]vectorize operand: "); - LLVM_DEBUG(operand->print(dbgs())); + LLVM_DEBUG(dbgs() << "\n[early-vect]vectorize operand: " << operand); // 1. If this value has already been vectorized this round, we are done. - if (state->vectorizedSet.count(operand->getDefiningOp()) > 0) { + if (state->vectorizedSet.count(operand.getDefiningOp()) > 0) { LLVM_DEBUG(dbgs() << " -> already vector operand"); return operand; } @@ -995,24 +994,22 @@ static Value vectorizeOperand(Value operand, Operation *op, auto it = state->replacementMap.find(operand); if (it != state->replacementMap.end()) { auto res = it->second; - LLVM_DEBUG(dbgs() << "-> delayed replacement by: "); - LLVM_DEBUG(res->print(dbgs())); + LLVM_DEBUG(dbgs() << "-> delayed replacement by: " << res); return res; } // 2. TODO(ntv): broadcast needed. - if (operand->getType().isa()) { + if (operand.getType().isa()) { LLVM_DEBUG(dbgs() << "-> non-vectorizable"); return nullptr; } // 3. vectorize constant. - if (auto constant = dyn_cast(operand->getDefiningOp())) { + if (auto constant = dyn_cast(operand.getDefiningOp())) { return vectorizeConstant( op, constant, - VectorType::get(state->strategy->vectorSizes, operand->getType())); + VectorType::get(state->strategy->vectorSizes, operand.getType())); } // 4. currently non-vectorizable. - LLVM_DEBUG(dbgs() << "-> non-vectorizable"); - LLVM_DEBUG(operand->print(dbgs())); + LLVM_DEBUG(dbgs() << "-> non-vectorizable: " << operand); return nullptr; } @@ -1073,7 +1070,7 @@ static Operation *vectorizeOneOperation(Operation *opInst, SmallVector vectorTypes; for (auto v : opInst->getResults()) { vectorTypes.push_back( - VectorType::get(state->strategy->vectorSizes, v->getType())); + VectorType::get(state->strategy->vectorSizes, v.getType())); } SmallVector vectorOperands; for (auto v : opInst->getOperands()) { @@ -1179,7 +1176,7 @@ static LogicalResult vectorizeRootMatch(NestedMatch m, auto clonedLoop = cast(builder.clone(*loopInst)); struct Guard { LogicalResult failure() { - loop.getInductionVar()->replaceAllUsesWith(clonedLoop.getInductionVar()); + loop.getInductionVar().replaceAllUsesWith(clonedLoop.getInductionVar()); loop.erase(); return mlir::failure(); } -- cgit v1.2.3