diff options
| author | River Riddle <riverriddle@google.com> | 2020-01-11 08:54:04 -0800 |
|---|---|---|
| committer | River Riddle <riverriddle@google.com> | 2020-01-11 08:54:39 -0800 |
| commit | 2bdf33cc4c733342fc83081bc7410ac5e9a24f55 (patch) | |
| tree | 3306d769c2bbabda1060928e0cea79d021ea9da2 /mlir/tools | |
| parent | 1d641daf260308815d014d1bf1b424a1ed1e7277 (diff) | |
| download | bcm5719-llvm-2bdf33cc4c733342fc83081bc7410ac5e9a24f55.tar.gz bcm5719-llvm-2bdf33cc4c733342fc83081bc7410ac5e9a24f55.zip | |
[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
Diffstat (limited to 'mlir/tools')
| -rw-r--r-- | mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp | 2 | ||||
| -rw-r--r-- | mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp | 14 | ||||
| -rw-r--r-- | mlir/tools/mlir-tblgen/RewriterGen.cpp | 10 |
3 files changed, 13 insertions, 13 deletions
diff --git a/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp b/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp index 30f720e8d73..e7a4d6b5aa6 100644 --- a/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp +++ b/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp @@ -133,7 +133,7 @@ static bool emitOneBuilder(const Record &record, raw_ostream &os) { } else if (isResultName(op, name)) { bs << formatv("valueMapping[op.{0}()]", name); } else if (name == "_resultType") { - bs << "op.getResult()->getType().cast<LLVM::LLVMType>()." + bs << "op.getResult().getType().cast<LLVM::LLVMType>()." "getUnderlyingType()"; } else if (name == "_hasResult") { bs << "opInst.getNumResults() == 1"; diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp index c22aff17e53..92415733370 100644 --- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -694,7 +694,7 @@ void OpEmitter::genUseOperandAsResultTypeCollectiveParamBuilder() { } // Result types - SmallVector<std::string, 2> resultTypes(numResults, "operands[0]->getType()"); + SmallVector<std::string, 2> resultTypes(numResults, "operands[0].getType()"); body << " " << builderOpState << ".addTypes({" << llvm::join(resultTypes, ", ") << "});\n\n"; } @@ -733,7 +733,7 @@ void OpEmitter::genUseOperandAsResultTypeSeparateParamBuilder() { // Push all result types to the operation state const char *index = op.getOperand(0).isVariadic() ? ".front()" : ""; std::string resultType = - formatv("{0}{1}->getType()", getArgumentName(op, 0), index).str(); + formatv("{0}{1}.getType()", getArgumentName(op, 0), index).str(); m.body() << " " << builderOpState << ".addTypes({" << resultType; for (int i = 1; i != numResults; ++i) m.body() << ", " << resultType; @@ -1119,8 +1119,8 @@ void OpEmitter::genVerifier() { if (value.isVariadic()) break; if (!value.name.empty()) - verifyCtx.addSubst( - value.name, formatv("(*this->getOperation()->getOperand({0}))", i)); + verifyCtx.addSubst(value.name, + formatv("this->getOperation()->getOperand({0})", i)); } for (int i = 0, e = op.getNumResults(); i < e; ++i) { auto &value = op.getResult(i); @@ -1130,7 +1130,7 @@ void OpEmitter::genVerifier() { break; if (!value.name.empty()) verifyCtx.addSubst(value.name, - formatv("(*this->getOperation()->getResult({0}))", i)); + formatv("this->getOperation()->getResult({0})", i)); } // Verify the attributes have the correct type. @@ -1237,10 +1237,10 @@ void OpEmitter::genOperandResultVerifier(OpMethodBody &body, body << " (void)v;\n" << " if (!(" << tgfmt(constraint.getConditionTemplate(), - &fctx.withSelf("v->getType()")) + &fctx.withSelf("v.getType()")) << ")) {\n" << formatv(" return emitOpError(\"{0} #\") << index " - "<< \" must be {1}, but got \" << v->getType();\n", + "<< \" must be {1}, but got \" << v.getType();\n", valueKind, constraint.getDescription()) << " }\n" // if << " ++index;\n" diff --git a/mlir/tools/mlir-tblgen/RewriterGen.cpp b/mlir/tools/mlir-tblgen/RewriterGen.cpp index 92c2c790147..b3c83c34ca4 100644 --- a/mlir/tools/mlir-tblgen/RewriterGen.cpp +++ b/mlir/tools/mlir-tblgen/RewriterGen.cpp @@ -247,7 +247,7 @@ void PatternEmitter::emitOpMatch(DagNode tree, int depth) { os.indent(indent + 2) << formatv( "auto *op{0} = " - "(*castedOp{1}.getODSOperands({2}).begin())->getDefiningOp();\n", + "(*castedOp{1}.getODSOperands({2}).begin()).getDefiningOp();\n", depth + 1, depth, i); emitOpMatch(argTree, depth + 1); os.indent(indent + 2) @@ -295,8 +295,8 @@ void PatternEmitter::emitOperandMatch(DagNode tree, int argIndex, int depth, PrintFatalError(loc, error); } auto self = - formatv("(*castedOp{0}.getODSOperands({1}).begin())->getType()", - depth, argIndex); + formatv("(*castedOp{0}.getODSOperands({1}).begin()).getType()", depth, + argIndex); os.indent(indent) << "if (!(" << tgfmt(matcher.getConditionTemplate(), &fmtCtx.withSelf(self)) @@ -386,7 +386,7 @@ void PatternEmitter::emitMatchLogic(DagNode tree) { auto cmd = "if (!({0})) return matchFailure();\n"; if (isa<TypeConstraint>(constraint)) { - auto self = formatv("({0}->getType())", + auto self = formatv("({0}.getType())", symbolInfoMap.getValueAndRangeUse(entities.front())); os.indent(4) << formatv(cmd, tgfmt(condition, &fmtCtx.withSelf(self.str()))); @@ -819,7 +819,7 @@ std::string PatternEmitter::handleOpCreation(DagNode tree, int resultIndex, if (numResults != 0) { for (int i = 0; i < numResults; ++i) os.indent(6) << formatv("for (auto v : castedOp0.getODSResults({0})) {{" - "tblgen_types.push_back(v->getType()); }\n", + "tblgen_types.push_back(v.getType()); }\n", resultIndex + i); } os.indent(6) << formatv("{0} = rewriter.create<{1}>(loc, tblgen_types, " |

