mlir/LogicalResult: move into llvm (#97309)

This patch is part of a project to move the Presburger library into
LLVM.
This commit is contained in:
Ramkumar Ramachandra 2024-07-02 10:42:33 +01:00 committed by GitHub
parent 01134e69d2
commit db791b278a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
315 changed files with 737 additions and 894 deletions

View File

@ -205,10 +205,10 @@ public:
rewrite(mlir::cast<SourceOp>(op),
OpAdaptor(operands, mlir::cast<SourceOp>(op)), rewriter);
}
mlir::LogicalResult match(mlir::Operation *op) const final {
llvm::LogicalResult match(mlir::Operation *op) const final {
return match(mlir::cast<SourceOp>(op));
}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(mlir::Operation *op, mlir::ArrayRef<mlir::Value> operands,
mlir::ConversionPatternRewriter &rewriter) const final {
return matchAndRewrite(mlir::cast<SourceOp>(op),
@ -218,14 +218,14 @@ public:
/// Rewrite and Match methods that operate on the SourceOp type. These must be
/// overridden by the derived pattern class.
virtual mlir::LogicalResult match(SourceOp op) const {
virtual llvm::LogicalResult match(SourceOp op) const {
llvm_unreachable("must override match or matchAndRewrite");
}
virtual void rewrite(SourceOp op, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const {
llvm_unreachable("must override rewrite or matchAndRewrite");
}
virtual mlir::LogicalResult
virtual llvm::LogicalResult
matchAndRewrite(SourceOp op, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const {
if (mlir::failed(match(op)))
@ -246,14 +246,14 @@ public:
using FIROpConversion<FromOp>::FIROpConversion;
using OpAdaptor = typename FromOp::Adaptor;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(FromOp op, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const final {
mlir::Type ty = this->convertType(op.getType());
return doRewrite(op, ty, adaptor, rewriter);
}
virtual mlir::LogicalResult
virtual llvm::LogicalResult
doRewrite(FromOp addr, mlir::Type ty, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const = 0;
};

View File

@ -60,7 +60,7 @@ public:
mlir::Type indexType() const;
// fir.type<name(p : TY'...){f : TY...}> --> llvm<"%name = { ty... }">
std::optional<mlir::LogicalResult>
std::optional<llvm::LogicalResult>
convertRecordType(fir::RecordType derived,
llvm::SmallVectorImpl<mlir::Type> &results);

View File

@ -16,10 +16,10 @@
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/Operation.h"
#include "mlir/Support/LogicalResult.h"
#include "llvm/Support/LogicalResult.h"
namespace fir::detail {
mlir::LogicalResult verifyFirAliasTagOpInterface(mlir::Operation *op);
llvm::LogicalResult verifyFirAliasTagOpInterface(mlir::Operation *op);
} // namespace fir::detail
#include "flang/Optimizer/Dialect/FirAliasTagOpInterface.h.inc"

View File

@ -192,7 +192,7 @@ def fir_FortranVariableOpInterface : OpInterface<"FortranVariableOpInterface"> {
}
/// Interface verifier imlementation for declare operations.
mlir::LogicalResult verifyDeclareLikeOpImpl(mlir::Value memRef);
llvm::LogicalResult verifyDeclareLikeOpImpl(mlir::Value memRef);
}];

View File

@ -124,7 +124,7 @@ public:
private:
MatchResult badMapString(const llvm::Twine &ptr);
MatchResult parse(llvm::StringRef kindMap);
mlir::LogicalResult setDefaultKinds(llvm::ArrayRef<KindTy> defs);
llvm::LogicalResult setDefaultKinds(llvm::ArrayRef<KindTy> defs);
mlir::MLIRContext *context;
llvm::DenseMap<std::pair<char, KindTy>, Bitsize> intMap;

View File

@ -733,7 +733,7 @@ def hlfir_AssociateOp : hlfir_Op<"associate", [AttrSizedOperandSegments,
CArg<"mlir::Value", "{}">:$shape, CArg<"mlir::ValueRange", "{}">:$typeparams,
CArg<"fir::FortranVariableFlagsAttr", "{}">:$fortran_attrs)>,
OpBuilder<(ins "mlir::Value":$memref, CArg<"mlir::Value", "{}">:$shape,
CArg<"mlir::ValueRange", "{}">:$typeparams,
CArg<"mlir::ValueRange", "{}">:$typeparams,
CArg<"fir::FortranVariableFlagsAttr", "{}">:$fortran_attrs,
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>];
@ -1258,7 +1258,7 @@ def hlfir_OrderedAssignmentTreeOpInterface : OpInterface<"OrderedAssignmentTreeO
let extraClassDeclaration = [{
/// Interface verifier imlementation.
mlir::LogicalResult verifyImpl();
llvm::LogicalResult verifyImpl();
mlir::Block* getSubTreeBlock() {
mlir::Region* region = getSubTreeRegion();
@ -1733,8 +1733,8 @@ def hlfir_CharExtremumOp : hlfir_Op<"char_extremum",
[DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
let summary = "Find max/min from given character strings";
let description = [{
Find the lexicographical minimum or maximum of two or more character
strings of the same character kind and return the string with the lexicographical
Find the lexicographical minimum or maximum of two or more character
strings of the same character kind and return the string with the lexicographical
minimum or maximum number of characters. Example:
%0 = hlfir.char_extremum min, %arg0, %arg1 : (!fir.ref<!fir.char<1,10>>, !fir.ref<!fir.char<1,20>>) -> !hlfir.expr<!fir.char<1,10>>

View File

@ -113,7 +113,7 @@ namespace {
struct AddrOfOpConversion : public fir::FIROpConversion<fir::AddrOfOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::AddrOfOp addr, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
auto ty = convertType(addr.getType());
@ -174,7 +174,7 @@ namespace {
struct DeclareOpConversion : public fir::FIROpConversion<fir::cg::XDeclareOp> {
public:
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::cg::XDeclareOp declareOp, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
auto memRef = adaptor.getOperands()[0];
@ -197,7 +197,7 @@ namespace {
struct AllocaOpConversion : public fir::FIROpConversion<fir::AllocaOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::AllocaOp alloc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::ValueRange operands = adaptor.getOperands();
@ -294,7 +294,7 @@ namespace {
struct BoxAddrOpConversion : public fir::FIROpConversion<fir::BoxAddrOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxAddrOp boxaddr, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Value a = adaptor.getOperands()[0];
@ -316,7 +316,7 @@ struct BoxAddrOpConversion : public fir::FIROpConversion<fir::BoxAddrOp> {
struct BoxCharLenOpConversion : public fir::FIROpConversion<fir::BoxCharLenOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxCharLenOp boxCharLen, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Value boxChar = adaptor.getOperands()[0];
@ -339,7 +339,7 @@ struct BoxCharLenOpConversion : public fir::FIROpConversion<fir::BoxCharLenOp> {
struct BoxDimsOpConversion : public fir::FIROpConversion<fir::BoxDimsOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxDimsOp boxdims, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
llvm::SmallVector<mlir::Type, 3> resultTypes = {
@ -361,7 +361,7 @@ struct BoxDimsOpConversion : public fir::FIROpConversion<fir::BoxDimsOp> {
struct BoxEleSizeOpConversion : public fir::FIROpConversion<fir::BoxEleSizeOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxEleSizeOp boxelesz, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Value box = adaptor.getOperands()[0];
@ -379,7 +379,7 @@ struct BoxEleSizeOpConversion : public fir::FIROpConversion<fir::BoxEleSizeOp> {
struct BoxIsAllocOpConversion : public fir::FIROpConversion<fir::BoxIsAllocOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxIsAllocOp boxisalloc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Value box = adaptor.getOperands()[0];
@ -397,7 +397,7 @@ struct BoxIsAllocOpConversion : public fir::FIROpConversion<fir::BoxIsAllocOp> {
struct BoxIsArrayOpConversion : public fir::FIROpConversion<fir::BoxIsArrayOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxIsArrayOp boxisarray, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Value a = adaptor.getOperands()[0];
@ -416,7 +416,7 @@ struct BoxIsArrayOpConversion : public fir::FIROpConversion<fir::BoxIsArrayOp> {
struct BoxIsPtrOpConversion : public fir::FIROpConversion<fir::BoxIsPtrOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxIsPtrOp boxisptr, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Value box = adaptor.getOperands()[0];
@ -434,7 +434,7 @@ struct BoxIsPtrOpConversion : public fir::FIROpConversion<fir::BoxIsPtrOp> {
struct BoxRankOpConversion : public fir::FIROpConversion<fir::BoxRankOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxRankOp boxrank, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Value a = adaptor.getOperands()[0];
@ -456,7 +456,7 @@ struct BoxProcHostOpConversion
: public fir::FIROpConversion<fir::BoxProcHostOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxProcHostOp boxprochost, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
TODO(boxprochost.getLoc(), "fir.boxproc_host codegen");
@ -470,7 +470,7 @@ struct BoxTypeDescOpConversion
: public fir::FIROpConversion<fir::BoxTypeDescOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxTypeDescOp boxtypedesc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Value box = adaptor.getOperands()[0];
@ -488,7 +488,7 @@ struct BoxTypeCodeOpConversion
: public fir::FIROpConversion<fir::BoxTypeCodeOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxTypeCodeOp op, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Value box = adaptor.getOperands()[0];
@ -506,7 +506,7 @@ struct BoxTypeCodeOpConversion
struct StringLitOpConversion : public fir::FIROpConversion<fir::StringLitOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::StringLitOp constop, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
auto ty = convertType(constop.getType());
@ -547,7 +547,7 @@ struct StringLitOpConversion : public fir::FIROpConversion<fir::StringLitOp> {
struct CallOpConversion : public fir::FIROpConversion<fir::CallOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::CallOp call, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
llvm::SmallVector<mlir::Type> resultTys;
@ -578,7 +578,7 @@ namespace {
struct CmpcOpConversion : public fir::FIROpConversion<fir::CmpcOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::CmpcOp cmp, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::ValueRange operands = adaptor.getOperands();
@ -616,7 +616,7 @@ struct CmpcOpConversion : public fir::FIROpConversion<fir::CmpcOp> {
struct ConstcOpConversion : public fir::FIROpConversion<fir::ConstcOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::ConstcOp conc, OpAdaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = conc.getLoc();
@ -647,7 +647,7 @@ struct ConvertOpConversion : public fir::FIROpConversion<fir::ConvertOp> {
return mlir::isa<mlir::FloatType>(ty);
}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::ConvertOp convert, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
auto fromFirTy = convert.getValue().getType();
@ -814,7 +814,7 @@ struct ConvertOpConversion : public fir::FIROpConversion<fir::ConvertOp> {
struct TypeInfoOpConversion : public fir::FIROpConversion<fir::TypeInfoOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::TypeInfoOp op, OpAdaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
rewriter.eraseOp(op);
@ -827,7 +827,7 @@ struct TypeInfoOpConversion : public fir::FIROpConversion<fir::TypeInfoOp> {
struct DTEntryOpConversion : public fir::FIROpConversion<fir::DTEntryOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::DTEntryOp op, OpAdaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
rewriter.eraseOp(op);
@ -839,7 +839,7 @@ struct DTEntryOpConversion : public fir::FIROpConversion<fir::DTEntryOp> {
struct GlobalLenOpConversion : public fir::FIROpConversion<fir::GlobalLenOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::GlobalLenOp globalLen, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
TODO(globalLen.getLoc(), "fir.global_len codegen");
@ -853,7 +853,7 @@ struct LenParamIndexOpConversion
using FIROpConversion::FIROpConversion;
// FIXME: this should be specialized by the runtime target
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::LenParamIndexOp lenp, OpAdaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
TODO(lenp.getLoc(), "fir.len_param_index codegen");
@ -867,7 +867,7 @@ struct LenParamIndexOpConversion
struct EmboxCharOpConversion : public fir::FIROpConversion<fir::EmboxCharOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::EmboxCharOp emboxChar, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::ValueRange operands = adaptor.getOperands();
@ -960,7 +960,7 @@ namespace {
struct AllocMemOpConversion : public fir::FIROpConversion<fir::AllocMemOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::AllocMemOp heap, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Type heapTy = heap.getType();
@ -1030,7 +1030,7 @@ namespace {
struct FreeMemOpConversion : public fir::FIROpConversion<fir::FreeMemOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::FreeMemOp freemem, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = freemem.getLoc();
@ -1481,7 +1481,7 @@ computeTripletExtent(mlir::ConversionPatternRewriter &rewriter,
struct EmboxOpConversion : public EmboxCommonConversion<fir::EmboxOp> {
using EmboxCommonConversion::EmboxCommonConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::EmboxOp embox, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::ValueRange operands = adaptor.getOperands();
@ -1513,7 +1513,7 @@ struct EmboxOpConversion : public EmboxCommonConversion<fir::EmboxOp> {
struct XEmboxOpConversion : public EmboxCommonConversion<fir::cg::XEmboxOp> {
using EmboxCommonConversion::EmboxCommonConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::cg::XEmboxOp xbox, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::ValueRange operands = adaptor.getOperands();
@ -1711,7 +1711,7 @@ struct XEmboxOpConversion : public EmboxCommonConversion<fir::cg::XEmboxOp> {
struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
using EmboxCommonConversion::EmboxCommonConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::cg::XReboxOp rebox, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = rebox.getLoc();
@ -1794,7 +1794,7 @@ struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
private:
/// Write resulting shape and base address in descriptor, and replace rebox
/// op.
mlir::LogicalResult
llvm::LogicalResult
finalizeRebox(fir::cg::XReboxOp rebox, mlir::Type destBoxTy, mlir::Value dest,
mlir::Value base, mlir::ValueRange lbounds,
mlir::ValueRange extents, mlir::ValueRange strides,
@ -1825,7 +1825,7 @@ private:
}
// Apply slice given the base address, extents and strides of the input box.
mlir::LogicalResult
llvm::LogicalResult
sliceBox(fir::cg::XReboxOp rebox, mlir::Type destBoxTy, mlir::Value dest,
mlir::Value base, mlir::ValueRange inputExtents,
mlir::ValueRange inputStrides, mlir::ValueRange operands,
@ -1908,7 +1908,7 @@ private:
/// Apply a new shape to the data described by a box given the base address,
/// extents and strides of the box.
mlir::LogicalResult
llvm::LogicalResult
reshapeBox(fir::cg::XReboxOp rebox, mlir::Type destBoxTy, mlir::Value dest,
mlir::Value base, mlir::ValueRange inputExtents,
mlir::ValueRange inputStrides, mlir::ValueRange operands,
@ -1960,7 +1960,7 @@ private:
struct EmboxProcOpConversion : public fir::FIROpConversion<fir::EmboxProcOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::EmboxProcOp emboxproc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
TODO(emboxproc.getLoc(), "fir.emboxproc codegen");
@ -2027,7 +2027,7 @@ struct ExtractValueOpConversion
public ValueOpCommon {
using FIROpAndTypeConversion::FIROpAndTypeConversion;
mlir::LogicalResult
llvm::LogicalResult
doRewrite(fir::ExtractValueOp extractVal, mlir::Type ty, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::ValueRange operands = adaptor.getOperands();
@ -2046,7 +2046,7 @@ struct InsertValueOpConversion
public ValueOpCommon {
using FIROpAndTypeConversion::FIROpAndTypeConversion;
mlir::LogicalResult
llvm::LogicalResult
doRewrite(fir::InsertValueOp insertVal, mlir::Type ty, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::ValueRange operands = adaptor.getOperands();
@ -2074,7 +2074,7 @@ struct InsertOnRangeOpConversion
}
}
mlir::LogicalResult
llvm::LogicalResult
doRewrite(fir::InsertOnRangeOp range, mlir::Type ty, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
@ -2127,7 +2127,7 @@ struct XArrayCoorOpConversion
: public fir::FIROpAndTypeConversion<fir::cg::XArrayCoorOp> {
using FIROpAndTypeConversion::FIROpAndTypeConversion;
mlir::LogicalResult
llvm::LogicalResult
doRewrite(fir::cg::XArrayCoorOp coor, mlir::Type llvmPtrTy, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
auto loc = coor.getLoc();
@ -2296,7 +2296,7 @@ struct CoordinateOpConversion
: public fir::FIROpAndTypeConversion<fir::CoordinateOp> {
using FIROpAndTypeConversion::FIROpAndTypeConversion;
mlir::LogicalResult
llvm::LogicalResult
doRewrite(fir::CoordinateOp coor, mlir::Type ty, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::ValueRange operands = adaptor.getOperands();
@ -2396,7 +2396,7 @@ struct CoordinateOpConversion
}
private:
mlir::LogicalResult
llvm::LogicalResult
doRewriteBox(fir::CoordinateOp coor, mlir::ValueRange operands,
mlir::Location loc,
mlir::ConversionPatternRewriter &rewriter) const {
@ -2482,7 +2482,7 @@ private:
return mlir::success();
}
mlir::LogicalResult
llvm::LogicalResult
doRewriteRefOrPtr(fir::CoordinateOp coor, mlir::Type llvmObjectTy,
mlir::ValueRange operands, mlir::Location loc,
mlir::ConversionPatternRewriter &rewriter) const {
@ -2593,7 +2593,7 @@ struct FieldIndexOpConversion : public fir::FIROpConversion<fir::FieldIndexOp> {
using FIROpConversion::FIROpConversion;
// NB: most field references should be resolved by this point
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::FieldIndexOp field, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
auto recTy = mlir::cast<fir::RecordType>(field.getOnType());
@ -2633,7 +2633,7 @@ struct FieldIndexOpConversion : public fir::FIROpConversion<fir::FieldIndexOp> {
struct FirEndOpConversion : public fir::FIROpConversion<fir::FirEndOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::FirEndOp firEnd, OpAdaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
TODO(firEnd.getLoc(), "fir.end codegen");
@ -2645,7 +2645,7 @@ struct FirEndOpConversion : public fir::FIROpConversion<fir::FirEndOp> {
struct TypeDescOpConversion : public fir::FIROpConversion<fir::TypeDescOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::TypeDescOp typeDescOp, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Type inTy = typeDescOp.getInType();
@ -2672,7 +2672,7 @@ struct TypeDescOpConversion : public fir::FIROpConversion<fir::TypeDescOp> {
struct HasValueOpConversion : public fir::FIROpConversion<fir::HasValueOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::HasValueOp op, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
rewriter.replaceOpWithNewOp<mlir::LLVM::ReturnOp>(op,
@ -2725,7 +2725,7 @@ static inline bool attributeTypeIsCompatible(mlir::MLIRContext *ctx,
struct GlobalOpConversion : public fir::FIROpConversion<fir::GlobalOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::GlobalOp global, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
@ -2867,7 +2867,7 @@ private:
struct LoadOpConversion : public fir::FIROpConversion<fir::LoadOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::LoadOp load, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Type llvmLoadTy = convertObjectType(load.getType());
@ -2925,7 +2925,7 @@ struct LoadOpConversion : public fir::FIROpConversion<fir::LoadOp> {
struct NoReassocOpConversion : public fir::FIROpConversion<fir::NoReassocOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::NoReassocOp noreassoc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
rewriter.replaceOp(noreassoc, adaptor.getOperands()[0]);
@ -2986,7 +2986,7 @@ static void genCaseLadderStep(mlir::Location loc, mlir::Value cmp,
struct SelectCaseOpConversion : public fir::FIROpConversion<fir::SelectCaseOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::SelectCaseOp caseOp, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
unsigned conds = caseOp.getNumConditions();
@ -3101,7 +3101,7 @@ static void selectMatchAndRewrite(const fir::LLVMTypeConverter &lowering,
struct SelectOpConversion : public fir::FIROpConversion<fir::SelectOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::SelectOp op, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
selectMatchAndRewrite<fir::SelectOp>(lowerTy(), op, adaptor, rewriter);
@ -3113,7 +3113,7 @@ struct SelectOpConversion : public fir::FIROpConversion<fir::SelectOp> {
struct SelectRankOpConversion : public fir::FIROpConversion<fir::SelectRankOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::SelectRankOp op, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
selectMatchAndRewrite<fir::SelectRankOp>(lowerTy(), op, adaptor, rewriter);
@ -3125,7 +3125,7 @@ struct SelectRankOpConversion : public fir::FIROpConversion<fir::SelectRankOp> {
struct SelectTypeOpConversion : public fir::FIROpConversion<fir::SelectTypeOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::SelectTypeOp select, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::emitError(select.getLoc(),
@ -3138,7 +3138,7 @@ struct SelectTypeOpConversion : public fir::FIROpConversion<fir::SelectTypeOp> {
struct StoreOpConversion : public fir::FIROpConversion<fir::StoreOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::StoreOp store, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = store.getLoc();
@ -3181,7 +3181,7 @@ namespace {
struct UnboxCharOpConversion : public fir::FIROpConversion<fir::UnboxCharOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::UnboxCharOp unboxchar, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Type lenTy = convertType(unboxchar.getType(1));
@ -3206,7 +3206,7 @@ struct UnboxCharOpConversion : public fir::FIROpConversion<fir::UnboxCharOp> {
struct UnboxProcOpConversion : public fir::FIROpConversion<fir::UnboxProcOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::UnboxProcOp unboxproc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
TODO(unboxproc.getLoc(), "fir.unboxproc codegen");
@ -3218,7 +3218,7 @@ struct UnboxProcOpConversion : public fir::FIROpConversion<fir::UnboxProcOp> {
struct UndefOpConversion : public fir::FIROpConversion<fir::UndefOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::UndefOp undef, OpAdaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
rewriter.replaceOpWithNewOp<mlir::LLVM::UndefOp>(
@ -3230,7 +3230,7 @@ struct UndefOpConversion : public fir::FIROpConversion<fir::UndefOp> {
struct ZeroOpConversion : public fir::FIROpConversion<fir::ZeroOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::ZeroOp zero, OpAdaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Type ty = convertType(zero.getType());
@ -3244,7 +3244,7 @@ struct UnreachableOpConversion
: public fir::FIROpConversion<fir::UnreachableOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::UnreachableOp unreach, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
rewriter.replaceOpWithNewOp<mlir::LLVM::UnreachableOp>(unreach);
@ -3261,7 +3261,7 @@ struct UnreachableOpConversion
struct IsPresentOpConversion : public fir::FIROpConversion<fir::IsPresentOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::IsPresentOp isPresent, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Type idxTy = lowerTy().indexType();
@ -3290,7 +3290,7 @@ struct IsPresentOpConversion : public fir::FIROpConversion<fir::IsPresentOp> {
struct AbsentOpConversion : public fir::FIROpConversion<fir::AbsentOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::AbsentOp absent, OpAdaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Type ty = convertType(absent.getType());
@ -3350,7 +3350,7 @@ namespace {
struct AddcOpConversion : public fir::FIROpConversion<fir::AddcOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::AddcOp addc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
// given: (x + iy) + (x' + iy')
@ -3365,7 +3365,7 @@ struct AddcOpConversion : public fir::FIROpConversion<fir::AddcOp> {
struct SubcOpConversion : public fir::FIROpConversion<fir::SubcOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::SubcOp subc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
// given: (x + iy) - (x' + iy')
@ -3381,7 +3381,7 @@ struct SubcOpConversion : public fir::FIROpConversion<fir::SubcOp> {
struct MulcOpConversion : public fir::FIROpConversion<fir::MulcOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::MulcOp mulc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
// TODO: Can we use a call to __muldc3 ?
@ -3415,7 +3415,7 @@ struct MulcOpConversion : public fir::FIROpConversion<fir::MulcOp> {
struct DivcOpConversion : public fir::FIROpConversion<fir::DivcOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::DivcOp divc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
// TODO: Can we use a call to __divdc3 instead?
@ -3455,7 +3455,7 @@ struct DivcOpConversion : public fir::FIROpConversion<fir::DivcOp> {
struct NegcOpConversion : public fir::FIROpConversion<fir::NegcOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::NegcOp neg, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
// given: -(x + iy)
@ -3476,7 +3476,7 @@ struct NegcOpConversion : public fir::FIROpConversion<fir::NegcOp> {
struct BoxOffsetOpConversion : public fir::FIROpConversion<fir::BoxOffsetOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::BoxOffsetOp boxOffset, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
@ -3505,7 +3505,7 @@ struct MustBeDeadConversion : public fir::FIROpConversion<FromOp> {
: fir::FIROpConversion<FromOp>(lowering, options) {}
using OpAdaptor = typename FromOp::Adaptor;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(FromOp op, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const final {
if (!op->getUses().empty())
@ -3519,7 +3519,7 @@ struct UnrealizedConversionCastOpConversion
: public fir::FIROpConversion<mlir::UnrealizedConversionCastOp> {
using FIROpConversion::FIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(mlir::UnrealizedConversionCastOp op, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
assert(op.getOutputs().getTypes().size() == 1 && "expect a single type");
@ -3562,7 +3562,7 @@ class RenameMSVCLibmCallees
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(mlir::LLVM::CallOp op,
mlir::PatternRewriter &rewriter) const override {
rewriter.startOpModification(op);
@ -3581,7 +3581,7 @@ class RenameMSVCLibmFuncs
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(mlir::LLVM::LLVMFuncOp op,
mlir::PatternRewriter &rewriter) const override {
rewriter.startOpModification(op);

View File

@ -59,7 +59,7 @@ struct MapInfoOpConversion
: public OpenMPFIROpConversion<mlir::omp::MapInfoOp> {
using OpenMPFIROpConversion::OpenMPFIROpConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(mlir::omp::MapInfoOp curOp, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
const mlir::TypeConverter *converter = getTypeConverter();

View File

@ -80,7 +80,7 @@ class EmboxConversion : public mlir::OpRewritePattern<fir::EmboxOp> {
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::EmboxOp embox,
mlir::PatternRewriter &rewriter) const override {
// If the embox does not include a shape, then do not convert it
@ -95,7 +95,7 @@ public:
return mlir::failure();
}
mlir::LogicalResult rewriteStaticShape(fir::EmboxOp embox,
llvm::LogicalResult rewriteStaticShape(fir::EmboxOp embox,
mlir::PatternRewriter &rewriter,
fir::SequenceType seqTy) const {
auto loc = embox.getLoc();
@ -115,7 +115,7 @@ public:
return mlir::success();
}
mlir::LogicalResult rewriteDynamicShape(fir::EmboxOp embox,
llvm::LogicalResult rewriteDynamicShape(fir::EmboxOp embox,
mlir::PatternRewriter &rewriter,
mlir::Value shapeVal) const {
auto loc = embox.getLoc();
@ -168,7 +168,7 @@ class ReboxConversion : public mlir::OpRewritePattern<fir::ReboxOp> {
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::ReboxOp rebox,
mlir::PatternRewriter &rewriter) const override {
auto loc = rebox.getLoc();
@ -227,7 +227,7 @@ class ArrayCoorConversion : public mlir::OpRewritePattern<fir::ArrayCoorOp> {
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::ArrayCoorOp arrCoor,
mlir::PatternRewriter &rewriter) const override {
auto loc = arrCoor.getLoc();
@ -277,7 +277,7 @@ public:
DeclareOpConversion(mlir::MLIRContext *ctx, bool preserveDecl)
: OpRewritePattern(ctx), preserveDeclare(preserveDecl) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::DeclareOp declareOp,
mlir::PatternRewriter &rewriter) const override {
if (!preserveDeclare) {
@ -316,7 +316,7 @@ class DummyScopeOpConversion
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::DummyScopeOp dummyScopeOp,
mlir::PatternRewriter &rewriter) const override {
rewriter.replaceOpWithNewOp<fir::UndefOp>(dummyScopeOp,

View File

@ -667,7 +667,7 @@ public:
/// Convert the type signatures on all the functions present in the module.
/// As the type signature is being changed, this must also update the
/// function itself to use any new arguments, etc.
mlir::LogicalResult convertTypes(mlir::ModuleOp mod) {
llvm::LogicalResult convertTypes(mlir::ModuleOp mod) {
mlir::MLIRContext *ctx = mod->getContext();
auto targetCPU = specifics->getTargetCPU();
mlir::StringAttr targetCPUAttr =

View File

@ -170,7 +170,7 @@ mlir::Type LLVMTypeConverter::indexType() const {
}
// fir.type<name(p : TY'...){f : TY...}> --> llvm<"%name = { ty... }">
std::optional<mlir::LogicalResult> LLVMTypeConverter::convertRecordType(
std::optional<llvm::LogicalResult> LLVMTypeConverter::convertRecordType(
fir::RecordType derived, llvm::SmallVectorImpl<mlir::Type> &results) {
auto name = fir::NameUniquer::dropTypeConversionMarkers(derived.getName());
auto st = mlir::LLVM::LLVMStructType::getIdentified(&getContext(), name);

View File

@ -51,7 +51,7 @@ void cuf::AllocOp::build(mlir::OpBuilder &builder, mlir::OperationState &result,
}
template <typename Op>
static mlir::LogicalResult checkCudaAttr(Op op) {
static llvm::LogicalResult checkCudaAttr(Op op) {
if (op.getDataAttr() == cuf::DataAttribute::Device ||
op.getDataAttr() == cuf::DataAttribute::Managed ||
op.getDataAttr() == cuf::DataAttribute::Unified)
@ -59,19 +59,19 @@ static mlir::LogicalResult checkCudaAttr(Op op) {
return op.emitOpError("expect device, managed or unified cuda attribute");
}
mlir::LogicalResult cuf::AllocOp::verify() { return checkCudaAttr(*this); }
llvm::LogicalResult cuf::AllocOp::verify() { return checkCudaAttr(*this); }
//===----------------------------------------------------------------------===//
// FreeOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult cuf::FreeOp::verify() { return checkCudaAttr(*this); }
llvm::LogicalResult cuf::FreeOp::verify() { return checkCudaAttr(*this); }
//===----------------------------------------------------------------------===//
// AllocateOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult cuf::AllocateOp::verify() {
llvm::LogicalResult cuf::AllocateOp::verify() {
if (getPinned() && getStream())
return emitOpError("pinned and stream cannot appears at the same time");
if (!mlir::isa<fir::BaseBoxType>(fir::unwrapRefType(getBox().getType())))
@ -94,7 +94,7 @@ mlir::LogicalResult cuf::AllocateOp::verify() {
// DataTransferOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult cuf::DataTransferOp::verify() {
llvm::LogicalResult cuf::DataTransferOp::verify() {
mlir::Type srcTy = getSrc().getType();
mlir::Type dstTy = getDst().getType();
if ((fir::isa_ref_type(srcTy) && fir::isa_ref_type(dstTy)) ||
@ -114,7 +114,7 @@ mlir::LogicalResult cuf::DataTransferOp::verify() {
// DeallocateOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult cuf::DeallocateOp::verify() {
llvm::LogicalResult cuf::DeallocateOp::verify() {
if (!mlir::isa<fir::BaseBoxType>(fir::unwrapRefType(getBox().getType())))
return emitOpError(
"expect box to be a reference to class or box type value");
@ -225,7 +225,7 @@ void printCUFKernelLoopControl(
p.printRegion(region, /*printEntryBlockArgs=*/false);
}
mlir::LogicalResult cuf::KernelOp::verify() {
llvm::LogicalResult cuf::KernelOp::verify() {
if (getLowerbound().size() != getUpperbound().size() ||
getLowerbound().size() != getStep().size())
return emitOpError(

View File

@ -263,7 +263,7 @@ void fir::AllocaOp::print(mlir::OpAsmPrinter &p) {
printAllocatableOp(p, *this);
}
mlir::LogicalResult fir::AllocaOp::verify() {
llvm::LogicalResult fir::AllocaOp::verify() {
llvm::SmallVector<llvm::StringRef> visited;
if (verifyInType(getInType(), visited, numShapeOperands()))
return emitOpError("invalid type for allocation");
@ -339,7 +339,7 @@ void fir::AllocMemOp::print(mlir::OpAsmPrinter &p) {
printAllocatableOp(p, *this);
}
mlir::LogicalResult fir::AllocMemOp::verify() {
llvm::LogicalResult fir::AllocMemOp::verify() {
llvm::SmallVector<llvm::StringRef> visited;
if (verifyInType(getInType(), visited, numShapeOperands()))
return emitOpError("invalid type for allocation");
@ -375,7 +375,7 @@ static bool validTypeParams(mlir::Type dynTy, mlir::ValueRange typeParams) {
return typeParams.size() == 0;
}
mlir::LogicalResult fir::ArrayCoorOp::verify() {
llvm::LogicalResult fir::ArrayCoorOp::verify() {
auto eleTy = fir::dyn_cast_ptrOrBoxEleTy(getMemref().getType());
auto arrTy = mlir::dyn_cast<fir::SequenceType>(eleTy);
if (!arrTy)
@ -424,7 +424,7 @@ mlir::LogicalResult fir::ArrayCoorOp::verify() {
// Pull in fir.embox and fir.rebox into fir.array_coor when possible.
struct SimplifyArrayCoorOp : public mlir::OpRewritePattern<fir::ArrayCoorOp> {
using mlir::OpRewritePattern<fir::ArrayCoorOp>::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::ArrayCoorOp op,
mlir::PatternRewriter &rewriter) const override {
mlir::Value memref = op.getMemref();
@ -821,7 +821,7 @@ std::vector<mlir::Value> fir::ArrayLoadOp::getExtents() {
return {};
}
mlir::LogicalResult fir::ArrayLoadOp::verify() {
llvm::LogicalResult fir::ArrayLoadOp::verify() {
auto eleTy = fir::dyn_cast_ptrOrBoxEleTy(getMemref().getType());
auto arrTy = mlir::dyn_cast<fir::SequenceType>(eleTy);
if (!arrTy)
@ -864,7 +864,7 @@ mlir::LogicalResult fir::ArrayLoadOp::verify() {
// ArrayMergeStoreOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::ArrayMergeStoreOp::verify() {
llvm::LogicalResult fir::ArrayMergeStoreOp::verify() {
if (!mlir::isa<fir::ArrayLoadOp>(getOriginal().getDefiningOp()))
return emitOpError("operand #0 must be result of a fir.array_load op");
if (auto sl = getSlice()) {
@ -914,7 +914,7 @@ mlir::Type validArraySubobject(A op) {
return fir::applyPathToType(ty, op.getIndices());
}
mlir::LogicalResult fir::ArrayFetchOp::verify() {
llvm::LogicalResult fir::ArrayFetchOp::verify() {
auto arrTy = mlir::cast<fir::SequenceType>(getSequence().getType());
auto indSize = getIndices().size();
if (indSize < arrTy.getDimension())
@ -936,7 +936,7 @@ mlir::LogicalResult fir::ArrayFetchOp::verify() {
// ArrayAccessOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::ArrayAccessOp::verify() {
llvm::LogicalResult fir::ArrayAccessOp::verify() {
auto arrTy = mlir::cast<fir::SequenceType>(getSequence().getType());
std::size_t indSize = getIndices().size();
if (indSize < arrTy.getDimension())
@ -956,7 +956,7 @@ mlir::LogicalResult fir::ArrayAccessOp::verify() {
// ArrayUpdateOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::ArrayUpdateOp::verify() {
llvm::LogicalResult fir::ArrayUpdateOp::verify() {
if (fir::isa_ref_type(getMerge().getType()))
return emitOpError("does not support reference type for merge");
auto arrTy = mlir::cast<fir::SequenceType>(getSequence().getType());
@ -978,7 +978,7 @@ mlir::LogicalResult fir::ArrayUpdateOp::verify() {
// ArrayModifyOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::ArrayModifyOp::verify() {
llvm::LogicalResult fir::ArrayModifyOp::verify() {
auto arrTy = mlir::cast<fir::SequenceType>(getSequence().getType());
auto indSize = getIndices().size();
if (indSize < arrTy.getDimension())
@ -1171,7 +1171,7 @@ void fir::CallOp::build(mlir::OpBuilder &builder, mlir::OperationState &result,
// CharConvertOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::CharConvertOp::verify() {
llvm::LogicalResult fir::CharConvertOp::verify() {
auto unwrap = [&](mlir::Type t) {
t = fir::unwrapSequenceType(fir::dyn_cast_ptrEleTy(t));
return mlir::dyn_cast<fir::CharacterType>(t);
@ -1294,7 +1294,7 @@ void fir::ConstcOp::print(mlir::OpAsmPrinter &p) {
p.printType(getType());
}
mlir::LogicalResult fir::ConstcOp::verify() {
llvm::LogicalResult fir::ConstcOp::verify() {
if (!mlir::isa<fir::ComplexType>(getType()))
return emitOpError("must be a !fir.complex type");
return mlir::success();
@ -1427,7 +1427,7 @@ bool fir::ConvertOp::canBeConverted(mlir::Type inType, mlir::Type outType) {
areVectorsCompatible(inType, outType);
}
mlir::LogicalResult fir::ConvertOp::verify() {
llvm::LogicalResult fir::ConvertOp::verify() {
if (canBeConverted(getValue().getType(), getType()))
return mlir::success();
return emitOpError("invalid type conversion")
@ -1468,7 +1468,7 @@ mlir::ParseResult fir::CoordinateOp::parse(mlir::OpAsmParser &parser,
return mlir::success();
}
mlir::LogicalResult fir::CoordinateOp::verify() {
llvm::LogicalResult fir::CoordinateOp::verify() {
const mlir::Type refTy = getRef().getType();
if (fir::isa_ref_type(refTy)) {
auto eleTy = fir::dyn_cast_ptrEleTy(refTy);
@ -1551,7 +1551,7 @@ mlir::LogicalResult fir::CoordinateOp::verify() {
// DispatchOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::DispatchOp::verify() {
llvm::LogicalResult fir::DispatchOp::verify() {
// Check that pass_arg_pos is in range of actual operands. pass_arg_pos is
// unsigned so check for less than zero is not needed.
if (getPassArgPos() && *getPassArgPos() > (getArgOperands().size() - 1))
@ -1588,7 +1588,7 @@ void fir::TypeInfoOp::build(mlir::OpBuilder &builder,
result.addAttributes(attrs);
}
mlir::LogicalResult fir::TypeInfoOp::verify() {
llvm::LogicalResult fir::TypeInfoOp::verify() {
if (!getDispatchTable().empty())
for (auto &op : getDispatchTable().front().without_terminator())
if (!mlir::isa<fir::DTEntryOp>(op))
@ -1606,7 +1606,7 @@ mlir::LogicalResult fir::TypeInfoOp::verify() {
// EmboxOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::EmboxOp::verify() {
llvm::LogicalResult fir::EmboxOp::verify() {
auto eleTy = fir::dyn_cast_ptrEleTy(getMemref().getType());
bool isArray = false;
if (auto seqTy = mlir::dyn_cast<fir::SequenceType>(eleTy)) {
@ -1642,7 +1642,7 @@ mlir::LogicalResult fir::EmboxOp::verify() {
// EmboxCharOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::EmboxCharOp::verify() {
llvm::LogicalResult fir::EmboxCharOp::verify() {
auto eleTy = fir::dyn_cast_ptrEleTy(getMemref().getType());
if (!mlir::dyn_cast_or_null<fir::CharacterType>(eleTy))
return mlir::failure();
@ -1653,7 +1653,7 @@ mlir::LogicalResult fir::EmboxCharOp::verify() {
// EmboxProcOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::EmboxProcOp::verify() {
llvm::LogicalResult fir::EmboxProcOp::verify() {
// host bindings (optional) must be a reference to a tuple
if (auto h = getHost()) {
if (auto r = mlir::dyn_cast<fir::ReferenceType>(h.getType()))
@ -1691,7 +1691,7 @@ void fir::TypeDescOp::print(mlir::OpAsmPrinter &p) {
p.printOptionalAttrDict(getOperation()->getAttrs(), {"in_type"});
}
mlir::LogicalResult fir::TypeDescOp::verify() {
llvm::LogicalResult fir::TypeDescOp::verify() {
mlir::Type resultTy = getType();
if (auto tdesc = mlir::dyn_cast<fir::TypeDescType>(resultTy)) {
if (tdesc.getOfTy() != getInType())
@ -2036,7 +2036,7 @@ static void printCustomRangeSubscript(mlir::OpAsmPrinter &printer,
}
/// Range bounds must be nonnegative, and the range must not be empty.
mlir::LogicalResult fir::InsertOnRangeOp::verify() {
llvm::LogicalResult fir::InsertOnRangeOp::verify() {
if (fir::hasDynamicSize(getSeq().getType()))
return emitOpError("must have constant shape and size");
mlir::DenseIntElementsAttr coorAttr = getCoor();
@ -2079,7 +2079,7 @@ struct UndoComplexPattern : public mlir::RewritePattern {
UndoComplexPattern(mlir::MLIRContext *ctx)
: mlir::RewritePattern("fir.insert_value", 2, ctx) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(mlir::Operation *op,
mlir::PatternRewriter &rewriter) const override {
auto insval = mlir::dyn_cast_or_null<fir::InsertValueOp>(op);
@ -2250,7 +2250,7 @@ mlir::ParseResult fir::IterWhileOp::parse(mlir::OpAsmParser &parser,
return mlir::success();
}
mlir::LogicalResult fir::IterWhileOp::verify() {
llvm::LogicalResult fir::IterWhileOp::verify() {
// Check that the body defines as single block argument for the induction
// variable.
auto *body = getBody();
@ -2610,7 +2610,7 @@ fir::DoLoopOp fir::getForInductionVarOwner(mlir::Value val) {
}
// Lifted from loop.loop
mlir::LogicalResult fir::DoLoopOp::verify() {
llvm::LogicalResult fir::DoLoopOp::verify() {
// Check that the body defines as single block argument for the induction
// variable.
auto *body = getBody();
@ -2785,7 +2785,7 @@ static bool areCompatibleCharacterTypes(mlir::Type t1, mlir::Type t2) {
return c1.getLen() == c2.getLen();
}
mlir::LogicalResult fir::ReboxOp::verify() {
llvm::LogicalResult fir::ReboxOp::verify() {
auto inputBoxTy = getBox().getType();
if (fir::isa_unknown_size_box(inputBoxTy))
return emitOpError("box operand must not have unknown rank or type");
@ -2883,7 +2883,7 @@ static bool areCompatibleAssumedRankElementType(mlir::Type inputEleTy,
return false;
}
mlir::LogicalResult fir::ReboxAssumedRankOp::verify() {
llvm::LogicalResult fir::ReboxAssumedRankOp::verify() {
mlir::Type inputType = getBox().getType();
if (!mlir::isa<fir::BaseBoxType>(inputType) && !fir::isBoxAddress(inputType))
return emitOpError("input must be a box or box address");
@ -2911,7 +2911,7 @@ void fir::ReboxAssumedRankOp::getEffects(
// ResultOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::ResultOp::verify() {
llvm::LogicalResult fir::ResultOp::verify() {
auto *parentOp = (*this)->getParentOp();
auto results = parentOp->getResults();
auto operands = (*this)->getOperands();
@ -2928,7 +2928,7 @@ mlir::LogicalResult fir::ResultOp::verify() {
// SaveResultOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::SaveResultOp::verify() {
llvm::LogicalResult fir::SaveResultOp::verify() {
auto resultType = getValue().getType();
if (resultType != fir::dyn_cast_ptrEleTy(getMemref().getType()))
return emitOpError("value type must match memory reference type");
@ -2992,7 +2992,7 @@ static constexpr llvm::StringRef getTargetOffsetAttr() {
}
template <typename OpT>
static mlir::LogicalResult verifyIntegralSwitchTerminator(OpT op) {
static llvm::LogicalResult verifyIntegralSwitchTerminator(OpT op) {
if (!mlir::isa<mlir::IntegerType, mlir::IndexType, fir::IntegerType>(
op.getSelector().getType()))
return op.emitOpError("must be an integer");
@ -3086,7 +3086,7 @@ static void printIntegralSwitchTerminator(OpT op, mlir::OpAsmPrinter &p) {
// SelectOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::SelectOp::verify() {
llvm::LogicalResult fir::SelectOp::verify() {
return verifyIntegralSwitchTerminator(*this);
}
@ -3412,7 +3412,7 @@ void fir::SelectCaseOp::build(mlir::OpBuilder &builder,
destOperands, attributes);
}
mlir::LogicalResult fir::SelectCaseOp::verify() {
llvm::LogicalResult fir::SelectCaseOp::verify() {
if (!mlir::isa<mlir::IntegerType, mlir::IndexType, fir::IntegerType,
fir::LogicalType, fir::CharacterType>(getSelector().getType()))
return emitOpError("must be an integer, character, or logical");
@ -3443,7 +3443,7 @@ mlir::LogicalResult fir::SelectCaseOp::verify() {
// SelectRankOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::SelectRankOp::verify() {
llvm::LogicalResult fir::SelectRankOp::verify() {
return verifyIntegralSwitchTerminator(*this);
}
@ -3608,7 +3608,7 @@ void fir::SelectTypeOp::print(mlir::OpAsmPrinter &p) {
fir::SelectTypeOp::getOperandSegmentSizeAttr()});
}
mlir::LogicalResult fir::SelectTypeOp::verify() {
llvm::LogicalResult fir::SelectTypeOp::verify() {
if (!mlir::isa<fir::BaseBoxType>(getSelector().getType()))
return emitOpError("must be a fir.class or fir.box type");
if (auto boxType = mlir::dyn_cast<fir::BoxType>(getSelector().getType()))
@ -3670,7 +3670,7 @@ void fir::SelectTypeOp::build(mlir::OpBuilder &builder,
// ShapeOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::ShapeOp::verify() {
llvm::LogicalResult fir::ShapeOp::verify() {
auto size = getExtents().size();
auto shapeTy = mlir::dyn_cast<fir::ShapeType>(getType());
assert(shapeTy && "must be a shape type");
@ -3689,7 +3689,7 @@ void fir::ShapeOp::build(mlir::OpBuilder &builder, mlir::OperationState &result,
// ShapeShiftOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::ShapeShiftOp::verify() {
llvm::LogicalResult fir::ShapeShiftOp::verify() {
auto size = getPairs().size();
if (size < 2 || size > 16 * 2)
return emitOpError("incorrect number of args");
@ -3706,7 +3706,7 @@ mlir::LogicalResult fir::ShapeShiftOp::verify() {
// ShiftOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::ShiftOp::verify() {
llvm::LogicalResult fir::ShiftOp::verify() {
auto size = getOrigins().size();
auto shiftTy = mlir::dyn_cast<fir::ShiftType>(getType());
assert(shiftTy && "must be a shift type");
@ -3742,7 +3742,7 @@ unsigned fir::SliceOp::getOutputRank(mlir::ValueRange triples) {
return rank;
}
mlir::LogicalResult fir::SliceOp::verify() {
llvm::LogicalResult fir::SliceOp::verify() {
auto size = getTriples().size();
if (size < 3 || size > 16 * 3)
return emitOpError("incorrect number of args for triple");
@ -3788,7 +3788,7 @@ void fir::StoreOp::print(mlir::OpAsmPrinter &p) {
p << " : " << getMemref().getType();
}
mlir::LogicalResult fir::StoreOp::verify() {
llvm::LogicalResult fir::StoreOp::verify() {
if (getValue().getType() != fir::dyn_cast_ptrEleTy(getMemref().getType()))
return emitOpError("store value type must match memory reference type");
return mlir::success();
@ -3920,7 +3920,7 @@ void fir::StringLitOp::print(mlir::OpAsmPrinter &p) {
p.printType(getType());
}
mlir::LogicalResult fir::StringLitOp::verify() {
llvm::LogicalResult fir::StringLitOp::verify() {
if (mlir::cast<mlir::IntegerAttr>(getSize()).getValue().isNegative())
return emitOpError("size must be non-negative");
if (auto xl = getOperation()->getAttr(fir::StringLitOp::xlist())) {
@ -3941,7 +3941,7 @@ mlir::LogicalResult fir::StringLitOp::verify() {
// UnboxProcOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::UnboxProcOp::verify() {
llvm::LogicalResult fir::UnboxProcOp::verify() {
if (auto eleTy = fir::dyn_cast_ptrEleTy(getRefTuple().getType()))
if (mlir::isa<mlir::TupleType>(eleTy))
return mlir::success();
@ -4067,7 +4067,7 @@ mlir::ParseResult fir::IfOp::parse(mlir::OpAsmParser &parser,
return mlir::success();
}
mlir::LogicalResult fir::IfOp::verify() {
llvm::LogicalResult fir::IfOp::verify() {
if (getNumResults() != 0 && getElseRegion().empty())
return emitOpError("must have an else block if defining values");
@ -4109,7 +4109,7 @@ void fir::IfOp::resultToSourceOps(llvm::SmallVectorImpl<mlir::Value> &results,
// BoxOffsetOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult fir::BoxOffsetOp::verify() {
llvm::LogicalResult fir::BoxOffsetOp::verify() {
auto boxType = mlir::dyn_cast_or_null<fir::BaseBoxType>(
fir::dyn_cast_ptrEleTy(getBoxRef().getType()));
if (!boxType)
@ -4402,7 +4402,7 @@ mlir::Type fir::applyPathToType(mlir::Type eleTy, mlir::ValueRange path) {
return eleTy;
}
mlir::LogicalResult fir::DeclareOp::verify() {
llvm::LogicalResult fir::DeclareOp::verify() {
auto fortranVar =
mlir::cast<fir::FortranVariableOpInterface>(this->getOperation());
return fortranVar.verifyDeclareLikeOpImpl(getMemref());

View File

@ -683,7 +683,7 @@ void fir::BoxProcType::print(mlir::AsmPrinter &printer) const {
printer << "<" << getEleTy() << '>';
}
mlir::LogicalResult
llvm::LogicalResult
BoxProcType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
mlir::Type eleTy) {
if (mlir::isa<mlir::FunctionType>(eleTy))
@ -704,7 +704,7 @@ static bool cannotBePointerOrHeapElementType(mlir::Type eleTy) {
// BoxType
//===----------------------------------------------------------------------===//
mlir::LogicalResult
llvm::LogicalResult
fir::BoxType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
mlir::Type eleTy) {
if (mlir::isa<fir::BaseBoxType>(eleTy))
@ -773,7 +773,7 @@ void fir::CharacterType::print(mlir::AsmPrinter &printer) const {
// ClassType
//===----------------------------------------------------------------------===//
mlir::LogicalResult
llvm::LogicalResult
fir::ClassType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
mlir::Type eleTy) {
if (mlir::isa<fir::RecordType, fir::SequenceType, fir::HeapType,
@ -820,7 +820,7 @@ void fir::HeapType::print(mlir::AsmPrinter &printer) const {
printer << "<" << getEleTy() << '>';
}
mlir::LogicalResult
llvm::LogicalResult
fir::HeapType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
mlir::Type eleTy) {
if (cannotBePointerOrHeapElementType(eleTy))
@ -868,7 +868,7 @@ void fir::PointerType::print(mlir::AsmPrinter &printer) const {
printer << "<" << getEleTy() << '>';
}
mlir::LogicalResult fir::PointerType::verify(
llvm::LogicalResult fir::PointerType::verify(
llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
mlir::Type eleTy) {
if (cannotBePointerOrHeapElementType(eleTy))
@ -889,7 +889,7 @@ void fir::RealType::print(mlir::AsmPrinter &printer) const {
printer << "<" << getFKind() << '>';
}
mlir::LogicalResult
llvm::LogicalResult
fir::RealType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
KindTy fKind) {
// TODO
@ -1012,7 +1012,7 @@ detail::RecordTypeStorage const *fir::RecordType::uniqueKey() const {
return getImpl();
}
mlir::LogicalResult fir::RecordType::verify(
llvm::LogicalResult fir::RecordType::verify(
llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
llvm::StringRef name) {
if (name.size() == 0)
@ -1047,7 +1047,7 @@ void fir::ReferenceType::print(mlir::AsmPrinter &printer) const {
printer << "<" << getEleTy() << '>';
}
mlir::LogicalResult fir::ReferenceType::verify(
llvm::LogicalResult fir::ReferenceType::verify(
llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
mlir::Type eleTy) {
if (mlir::isa<ShapeType, ShapeShiftType, SliceType, FieldType, LenType,
@ -1121,7 +1121,7 @@ unsigned fir::SequenceType::getConstantRows() const {
return count;
}
mlir::LogicalResult fir::SequenceType::verify(
llvm::LogicalResult fir::SequenceType::verify(
llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
llvm::ArrayRef<int64_t> shape, mlir::Type eleTy,
mlir::AffineMapAttr layoutMap) {
@ -1196,7 +1196,7 @@ void fir::TypeDescType::print(mlir::AsmPrinter &printer) const {
printer << "<" << getOfTy() << '>';
}
mlir::LogicalResult fir::TypeDescType::verify(
llvm::LogicalResult fir::TypeDescType::verify(
llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
mlir::Type eleTy) {
if (mlir::isa<BoxType, BoxCharType, BoxProcType, ShapeType, ShapeShiftType,
@ -1225,7 +1225,7 @@ void fir::VectorType::print(mlir::AsmPrinter &printer) const {
printer << "<" << getLen() << ':' << getEleTy() << '>';
}
mlir::LogicalResult fir::VectorType::verify(
llvm::LogicalResult fir::VectorType::verify(
llvm::function_ref<mlir::InFlightDiagnostic()> emitError, uint64_t len,
mlir::Type eleTy) {
if (!(fir::isa_real(eleTy) || fir::isa_integer(eleTy)))

View File

@ -15,17 +15,17 @@
#include "flang/Optimizer/Dialect/FirAliasTagOpInterface.cpp.inc"
mlir::LogicalResult
llvm::LogicalResult
fir::detail::verifyFirAliasTagOpInterface(mlir::Operation *op) {
auto iface = mlir::cast<FirAliasTagOpInterface>(op);
mlir::ArrayAttr tags = iface.getTBAATagsOrNull();
if (!tags)
return mlir::success();
return llvm::success();
for (mlir::Attribute iter : tags)
if (!mlir::isa<mlir::LLVM::TBAATagAttr>(iter))
return op->emitOpError("expected op to return array of ")
<< mlir::LLVM::TBAATagAttr::getMnemonic() << " attributes";
return mlir::success();
return llvm::success();
}

View File

@ -14,7 +14,7 @@
#include "flang/Optimizer/Dialect/FortranVariableInterface.cpp.inc"
mlir::LogicalResult
llvm::LogicalResult
fir::FortranVariableOpInterface::verifyDeclareLikeOpImpl(mlir::Value memref) {
const unsigned numExplicitTypeParams = getExplicitTypeParams().size();
mlir::Type memType = memref.getType();

View File

@ -177,7 +177,7 @@ static MatchResult parseInt(unsigned &result, const char *&ptr,
return mlir::success();
}
static mlir::LogicalResult matchString(const char *&ptr, const char *endPtr,
static llvm::LogicalResult matchString(const char *&ptr, const char *endPtr,
llvm::StringRef literal) {
llvm::StringRef s(ptr, endPtr - ptr);
if (s.starts_with(literal)) {
@ -351,7 +351,7 @@ std::string fir::KindMapping::mapToString() const {
return result;
}
mlir::LogicalResult
llvm::LogicalResult
fir::KindMapping::setDefaultKinds(llvm::ArrayRef<KindTy> defs) {
if (defs.empty()) {
// generic front-end defaults

View File

@ -78,7 +78,7 @@ static bool isAllocatableBoxRef(mlir::Type type) {
return boxType && mlir::isa<fir::HeapType>(boxType.getEleTy());
}
mlir::LogicalResult hlfir::AssignOp::verify() {
llvm::LogicalResult hlfir::AssignOp::verify() {
mlir::Type lhsType = getLhs().getType();
if (isAllocatableAssignment() && !isAllocatableBoxRef(lhsType))
return emitOpError("lhs must be an allocatable when `realloc` is set");
@ -137,7 +137,7 @@ void hlfir::DeclareOp::build(mlir::OpBuilder &builder,
typeparams, dummy_scope, nameAttr, fortran_attrs, data_attr);
}
mlir::LogicalResult hlfir::DeclareOp::verify() {
llvm::LogicalResult hlfir::DeclareOp::verify() {
if (getMemref().getType() != getResult(1).getType())
return emitOpError("second result type must match input memref type");
mlir::Type hlfirVariableType = getHLFIRVariableType(
@ -278,7 +278,7 @@ static void printDesignatorComplexPart(mlir::OpAsmPrinter &p,
}
}
mlir::LogicalResult hlfir::DesignateOp::verify() {
llvm::LogicalResult hlfir::DesignateOp::verify() {
mlir::Type memrefType = getMemref().getType();
mlir::Type baseType = getFortranElementOrSequenceType(memrefType);
mlir::Type baseElementType = fir::unwrapSequenceType(baseType);
@ -433,7 +433,7 @@ mlir::LogicalResult hlfir::DesignateOp::verify() {
// ParentComponentOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::ParentComponentOp::verify() {
llvm::LogicalResult hlfir::ParentComponentOp::verify() {
mlir::Type baseType =
hlfir::getFortranElementOrSequenceType(getMemref().getType());
auto maybeInputSeqType = mlir::dyn_cast<fir::SequenceType>(baseType);
@ -488,7 +488,7 @@ mlir::LogicalResult hlfir::ParentComponentOp::verify() {
// LogicalReductionOp
//===----------------------------------------------------------------------===//
template <typename LogicalReductionOp>
static mlir::LogicalResult
static llvm::LogicalResult
verifyLogicalReductionOp(LogicalReductionOp reductionOp) {
mlir::Operation *op = reductionOp->getOperation();
@ -539,7 +539,7 @@ verifyLogicalReductionOp(LogicalReductionOp reductionOp) {
// AllOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::AllOp::verify() {
llvm::LogicalResult hlfir::AllOp::verify() {
return verifyLogicalReductionOp<hlfir::AllOp *>(this);
}
@ -554,7 +554,7 @@ void hlfir::AllOp::getEffects(
// AnyOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::AnyOp::verify() {
llvm::LogicalResult hlfir::AnyOp::verify() {
return verifyLogicalReductionOp<hlfir::AnyOp *>(this);
}
@ -569,7 +569,7 @@ void hlfir::AnyOp::getEffects(
// CountOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::CountOp::verify() {
llvm::LogicalResult hlfir::CountOp::verify() {
mlir::Operation *op = getOperation();
auto results = op->getResultTypes();
@ -626,7 +626,7 @@ getCharacterLengthIfStatic(mlir::Type t) {
return std::nullopt;
}
mlir::LogicalResult hlfir::ConcatOp::verify() {
llvm::LogicalResult hlfir::ConcatOp::verify() {
if (getStrings().size() < 2)
return emitOpError("must be provided at least two string operands");
unsigned kind = getCharacterKind(getResult().getType());
@ -668,7 +668,7 @@ void hlfir::ConcatOp::getEffects(
//===----------------------------------------------------------------------===//
template <typename NumericalReductionOp>
static mlir::LogicalResult
static llvm::LogicalResult
verifyArrayAndMaskForReductionOp(NumericalReductionOp reductionOp) {
mlir::Value array = reductionOp->getArray();
mlir::Value mask = reductionOp->getMask();
@ -707,7 +707,7 @@ verifyArrayAndMaskForReductionOp(NumericalReductionOp reductionOp) {
}
template <typename NumericalReductionOp>
static mlir::LogicalResult
static llvm::LogicalResult
verifyNumericalReductionOp(NumericalReductionOp reductionOp) {
mlir::Operation *op = reductionOp->getOperation();
auto results = op->getResultTypes();
@ -760,7 +760,7 @@ verifyNumericalReductionOp(NumericalReductionOp reductionOp) {
// ProductOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::ProductOp::verify() {
llvm::LogicalResult hlfir::ProductOp::verify() {
return verifyNumericalReductionOp<hlfir::ProductOp *>(this);
}
@ -776,7 +776,7 @@ void hlfir::ProductOp::getEffects(
//===----------------------------------------------------------------------===//
template <typename CharacterReductionOp>
static mlir::LogicalResult
static llvm::LogicalResult
verifyCharacterReductionOp(CharacterReductionOp reductionOp) {
mlir::Operation *op = reductionOp->getOperation();
auto results = op->getResultTypes();
@ -821,7 +821,7 @@ verifyCharacterReductionOp(CharacterReductionOp reductionOp) {
// MaxvalOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::MaxvalOp::verify() {
llvm::LogicalResult hlfir::MaxvalOp::verify() {
mlir::Operation *op = getOperation();
auto results = op->getResultTypes();
@ -845,7 +845,7 @@ void hlfir::MaxvalOp::getEffects(
// MinvalOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::MinvalOp::verify() {
llvm::LogicalResult hlfir::MinvalOp::verify() {
mlir::Operation *op = getOperation();
auto results = op->getResultTypes();
@ -870,7 +870,7 @@ void hlfir::MinvalOp::getEffects(
//===----------------------------------------------------------------------===//
template <typename NumericalReductionOp>
static mlir::LogicalResult
static llvm::LogicalResult
verifyResultForMinMaxLoc(NumericalReductionOp reductionOp) {
mlir::Operation *op = reductionOp->getOperation();
auto results = op->getResultTypes();
@ -908,7 +908,7 @@ verifyResultForMinMaxLoc(NumericalReductionOp reductionOp) {
return mlir::success();
}
mlir::LogicalResult hlfir::MinlocOp::verify() {
llvm::LogicalResult hlfir::MinlocOp::verify() {
auto res = verifyArrayAndMaskForReductionOp(this);
if (failed(res))
return res;
@ -927,7 +927,7 @@ void hlfir::MinlocOp::getEffects(
// MaxlocOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::MaxlocOp::verify() {
llvm::LogicalResult hlfir::MaxlocOp::verify() {
auto res = verifyArrayAndMaskForReductionOp(this);
if (failed(res))
return res;
@ -971,7 +971,7 @@ void hlfir::SetLengthOp::getEffects(
// SumOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::SumOp::verify() {
llvm::LogicalResult hlfir::SumOp::verify() {
return verifyNumericalReductionOp<hlfir::SumOp *>(this);
}
@ -986,7 +986,7 @@ void hlfir::SumOp::getEffects(
// DotProductOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::DotProductOp::verify() {
llvm::LogicalResult hlfir::DotProductOp::verify() {
mlir::Value lhs = getLhs();
mlir::Value rhs = getRhs();
fir::SequenceType lhsTy = mlir::cast<fir::SequenceType>(
@ -1042,7 +1042,7 @@ void hlfir::DotProductOp::getEffects(
// MatmulOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::MatmulOp::verify() {
llvm::LogicalResult hlfir::MatmulOp::verify() {
mlir::Value lhs = getLhs();
mlir::Value rhs = getRhs();
fir::SequenceType lhsTy = mlir::cast<fir::SequenceType>(
@ -1111,7 +1111,7 @@ mlir::LogicalResult hlfir::MatmulOp::verify() {
return mlir::success();
}
mlir::LogicalResult
llvm::LogicalResult
hlfir::MatmulOp::canonicalize(MatmulOp matmulOp,
mlir::PatternRewriter &rewriter) {
// the only two uses of the transposed matrix should be for the hlfir.matmul
@ -1170,7 +1170,7 @@ void hlfir::MatmulOp::getEffects(
// TransposeOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::TransposeOp::verify() {
llvm::LogicalResult hlfir::TransposeOp::verify() {
mlir::Value array = getArray();
fir::SequenceType arrayTy = mlir::cast<fir::SequenceType>(
hlfir::getFortranElementOrSequenceType(array.getType()));
@ -1212,7 +1212,7 @@ void hlfir::TransposeOp::getEffects(
// MatmulTransposeOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::MatmulTransposeOp::verify() {
llvm::LogicalResult hlfir::MatmulTransposeOp::verify() {
mlir::Value lhs = getLhs();
mlir::Value rhs = getRhs();
fir::SequenceType lhsTy = mlir::cast<fir::SequenceType>(
@ -1350,7 +1350,7 @@ void hlfir::EndAssociateOp::build(mlir::OpBuilder &builder,
associate.getMustFreeStrorageFlag());
}
mlir::LogicalResult hlfir::EndAssociateOp::verify() {
llvm::LogicalResult hlfir::EndAssociateOp::verify() {
mlir::Value var = getVar();
if (hlfir::mayHaveAllocatableComponent(var.getType()) &&
!hlfir::isFortranEntity(var))
@ -1438,7 +1438,7 @@ mlir::Value hlfir::ElementalOp::getElementEntity() {
return mlir::cast<hlfir::YieldElementOp>(getBody()->back()).getElementValue();
}
mlir::LogicalResult hlfir::ElementalOp::verify() {
llvm::LogicalResult hlfir::ElementalOp::verify() {
mlir::Value mold = getMold();
hlfir::ExprType resultType = mlir::cast<hlfir::ExprType>(getType());
if (!!mold != resultType.isPolymorphic())
@ -1476,7 +1476,7 @@ void hlfir::NullOp::build(mlir::OpBuilder &builder,
// DestroyOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::DestroyOp::verify() {
llvm::LogicalResult hlfir::DestroyOp::verify() {
if (mustFinalizeExpr()) {
mlir::Value expr = getExpr();
hlfir::ExprType exprTy = mlir::cast<hlfir::ExprType>(expr.getType());
@ -1517,7 +1517,7 @@ std::size_t hlfir::ShapeOfOp::getRank() {
return shape.getRank();
}
mlir::LogicalResult hlfir::ShapeOfOp::verify() {
llvm::LogicalResult hlfir::ShapeOfOp::verify() {
mlir::Value expr = getExpr();
hlfir::ExprType exprTy = mlir::cast<hlfir::ExprType>(expr.getType());
std::size_t exprRank = exprTy.getShape().size();
@ -1532,7 +1532,7 @@ mlir::LogicalResult hlfir::ShapeOfOp::verify() {
return mlir::success();
}
mlir::LogicalResult
llvm::LogicalResult
hlfir::ShapeOfOp::canonicalize(ShapeOfOp shapeOf,
mlir::PatternRewriter &rewriter) {
// if extent information is available at compile time, immediately fold the
@ -1544,11 +1544,11 @@ hlfir::ShapeOfOp::canonicalize(ShapeOfOp shapeOf,
mlir::Value shape = hlfir::genExprShape(rewriter, loc, expr);
if (!shape)
// shape information is not available at compile time
return mlir::LogicalResult::failure();
return llvm::LogicalResult::failure();
rewriter.replaceAllUsesWith(shapeOf.getResult(), shape);
rewriter.eraseOp(shapeOf);
return mlir::LogicalResult::success();
return llvm::LogicalResult::success();
}
//===----------------------------------------------------------------------===//
@ -1563,7 +1563,7 @@ void hlfir::GetExtentOp::build(mlir::OpBuilder &builder,
build(builder, result, indexTy, shape, dimAttr);
}
mlir::LogicalResult hlfir::GetExtentOp::verify() {
llvm::LogicalResult hlfir::GetExtentOp::verify() {
fir::ShapeType shapeTy = mlir::cast<fir::ShapeType>(getShape().getType());
std::uint64_t rank = shapeTy.getRank();
llvm::APInt dim = getDim();
@ -1640,7 +1640,7 @@ static mlir::Operation *getTerminator(mlir::Region &region) {
return &region.back().back();
}
mlir::LogicalResult hlfir::RegionAssignOp::verify() {
llvm::LogicalResult hlfir::RegionAssignOp::verify() {
if (!mlir::isa_and_nonnull<hlfir::YieldOp>(getTerminator(getRhsRegion())))
return emitOpError(
"right-hand side region must be terminated by an hlfir.yield");
@ -1692,7 +1692,7 @@ void hlfir::ElementalAddrOp::build(mlir::OpBuilder &builder,
odsState.addRegion();
}
mlir::LogicalResult hlfir::ElementalAddrOp::verify() {
llvm::LogicalResult hlfir::ElementalAddrOp::verify() {
hlfir::YieldOp yieldOp =
mlir::dyn_cast_or_null<hlfir::YieldOp>(getTerminator(getBody()));
if (!yieldOp)
@ -1729,7 +1729,7 @@ mlir::Region *hlfir::ElementalAddrOp::getElementCleanup() {
// OrderedAssignmentTreeOpInterface
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::OrderedAssignmentTreeOpInterface::verifyImpl() {
llvm::LogicalResult hlfir::OrderedAssignmentTreeOpInterface::verifyImpl() {
if (mlir::Region *body = getSubTreeRegion())
if (!body->empty())
for (mlir::Operation &op : body->front())
@ -1812,7 +1812,7 @@ static bool yieldsLogical(mlir::Region &region, bool mustBeScalarI1) {
hlfir::getFortranElementOrSequenceType(yieldType));
}
mlir::LogicalResult hlfir::ForallMaskOp::verify() {
llvm::LogicalResult hlfir::ForallMaskOp::verify() {
if (!yieldsLogical(getMaskRegion(), /*mustBeScalarI1=*/true))
return emitOpError("mask region must yield a scalar i1");
mlir::Operation *op = getOperation();
@ -1828,7 +1828,7 @@ mlir::LogicalResult hlfir::ForallMaskOp::verify() {
//===----------------------------------------------------------------------===//
template <typename ConcreteOp>
static mlir::LogicalResult verifyWhereAndElseWhereBody(ConcreteOp &concreteOp) {
static llvm::LogicalResult verifyWhereAndElseWhereBody(ConcreteOp &concreteOp) {
for (mlir::Operation &op : concreteOp.getBody().front())
if (mlir::isa<hlfir::ForallOp>(op))
return concreteOp.emitOpError(
@ -1836,13 +1836,13 @@ static mlir::LogicalResult verifyWhereAndElseWhereBody(ConcreteOp &concreteOp) {
return mlir::success();
}
mlir::LogicalResult hlfir::WhereOp::verify() {
llvm::LogicalResult hlfir::WhereOp::verify() {
if (!yieldsLogical(getMaskRegion(), /*mustBeScalarI1=*/false))
return emitOpError("mask region must yield a logical array");
return verifyWhereAndElseWhereBody(*this);
}
mlir::LogicalResult hlfir::ElseWhereOp::verify() {
llvm::LogicalResult hlfir::ElseWhereOp::verify() {
if (!getMaskRegion().empty())
if (!yieldsLogical(getMaskRegion(), /*mustBeScalarI1=*/false))
return emitOpError(
@ -1854,7 +1854,7 @@ mlir::LogicalResult hlfir::ElseWhereOp::verify() {
// ForallIndexOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult
llvm::LogicalResult
hlfir::ForallIndexOp::canonicalize(hlfir::ForallIndexOp indexOp,
mlir::PatternRewriter &rewriter) {
for (mlir::Operation *user : indexOp->getResult(0).getUsers())
@ -1878,7 +1878,7 @@ hlfir::ForallIndexOp::canonicalize(hlfir::ForallIndexOp indexOp,
// CharExtremumOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult hlfir::CharExtremumOp::verify() {
llvm::LogicalResult hlfir::CharExtremumOp::verify() {
if (getStrings().size() < 2)
return emitOpError("must be provided at least two string operands");
unsigned kind = getCharacterKind(getResult().getType());
@ -1922,7 +1922,7 @@ void hlfir::CharExtremumOp::getEffects(
// GetLength
//===----------------------------------------------------------------------===//
mlir::LogicalResult
llvm::LogicalResult
hlfir::GetLengthOp::canonicalize(GetLengthOp getLength,
mlir::PatternRewriter &rewriter) {
mlir::Location loc = getLength.getLoc();

View File

@ -30,7 +30,6 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/TypeSwitch.h"
@ -180,7 +179,7 @@ struct AsExprOpConversion : public mlir::OpConversionPattern<hlfir::AsExprOp> {
using mlir::OpConversionPattern<hlfir::AsExprOp>::OpConversionPattern;
explicit AsExprOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::AsExprOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::AsExprOp asExpr, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = asExpr->getLoc();
@ -205,7 +204,7 @@ struct ShapeOfOpConversion
: public mlir::OpConversionPattern<hlfir::ShapeOfOp> {
using mlir::OpConversionPattern<hlfir::ShapeOfOp>::OpConversionPattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::ShapeOfOp shapeOf, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = shapeOf.getLoc();
@ -237,7 +236,7 @@ struct ApplyOpConversion : public mlir::OpConversionPattern<hlfir::ApplyOp> {
using mlir::OpConversionPattern<hlfir::ApplyOp>::OpConversionPattern;
explicit ApplyOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::ApplyOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::ApplyOp apply, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = apply->getLoc();
@ -262,7 +261,7 @@ struct AssignOpConversion : public mlir::OpConversionPattern<hlfir::AssignOp> {
using mlir::OpConversionPattern<hlfir::AssignOp>::OpConversionPattern;
explicit AssignOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::AssignOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::AssignOp assign, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
llvm::SmallVector<mlir::Value> newOperands;
@ -279,7 +278,7 @@ struct ConcatOpConversion : public mlir::OpConversionPattern<hlfir::ConcatOp> {
using mlir::OpConversionPattern<hlfir::ConcatOp>::OpConversionPattern;
explicit ConcatOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::ConcatOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::ConcatOp concat, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = concat->getLoc();
@ -318,7 +317,7 @@ struct SetLengthOpConversion
using mlir::OpConversionPattern<hlfir::SetLengthOp>::OpConversionPattern;
explicit SetLengthOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::SetLengthOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::SetLengthOp setLength, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = setLength->getLoc();
@ -351,7 +350,7 @@ struct GetLengthOpConversion
using mlir::OpConversionPattern<hlfir::GetLengthOp>::OpConversionPattern;
explicit GetLengthOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::GetLengthOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::GetLengthOp getLength, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = getLength->getLoc();
@ -441,7 +440,7 @@ struct AssociateOpConversion
using mlir::OpConversionPattern<hlfir::AssociateOp>::OpConversionPattern;
explicit AssociateOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::AssociateOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::AssociateOp associate, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = associate->getLoc();
@ -660,7 +659,7 @@ struct EndAssociateOpConversion
using mlir::OpConversionPattern<hlfir::EndAssociateOp>::OpConversionPattern;
explicit EndAssociateOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::EndAssociateOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::EndAssociateOp endAssociate, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = endAssociate->getLoc();
@ -677,7 +676,7 @@ struct DestroyOpConversion
using mlir::OpConversionPattern<hlfir::DestroyOp>::OpConversionPattern;
explicit DestroyOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::DestroyOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::DestroyOp destroy, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
// If expr was bufferized on the heap, now is time to deallocate the buffer.
@ -706,7 +705,7 @@ struct NoReassocOpConversion
using mlir::OpConversionPattern<hlfir::NoReassocOp>::OpConversionPattern;
explicit NoReassocOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::NoReassocOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::NoReassocOp noreassoc, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = noreassoc->getLoc();
@ -767,7 +766,7 @@ struct ElementalOpConversion
// by the nesting level of ElementalOp's.
setHasBoundedRewriteRecursion();
}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::ElementalOp elemental, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = elemental->getLoc();
@ -860,7 +859,7 @@ struct CharExtremumOpConversion
using mlir::OpConversionPattern<hlfir::CharExtremumOp>::OpConversionPattern;
explicit CharExtremumOpConversion(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<hlfir::CharExtremumOp>{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::CharExtremumOp char_extremum, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = char_extremum->getLoc();

View File

@ -38,7 +38,7 @@ class AssignOpConversion : public mlir::OpRewritePattern<hlfir::AssignOp> {
public:
explicit AssignOpConversion(mlir::MLIRContext *ctx) : OpRewritePattern{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::AssignOp assignOp,
mlir::PatternRewriter &rewriter) const override {
mlir::Location loc = assignOp->getLoc();
@ -231,7 +231,7 @@ public:
return {res[0], res[1]};
}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::CopyInOp copyInOp,
mlir::PatternRewriter &rewriter) const override {
mlir::Location loc = copyInOp.getLoc();
@ -249,7 +249,7 @@ public:
explicit CopyOutOpConversion(mlir::MLIRContext *ctx)
: OpRewritePattern{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::CopyOutOp copyOutOp,
mlir::PatternRewriter &rewriter) const override {
mlir::Location loc = copyOutOp.getLoc();
@ -290,7 +290,7 @@ public:
explicit DeclareOpConversion(mlir::MLIRContext *ctx)
: OpRewritePattern{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::DeclareOp declareOp,
mlir::PatternRewriter &rewriter) const override {
mlir::Location loc = declareOp->getLoc();
@ -428,7 +428,7 @@ public:
explicit DesignateOpConversion(mlir::MLIRContext *ctx)
: OpRewritePattern{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::DesignateOp designate,
mlir::PatternRewriter &rewriter) const override {
mlir::Location loc = designate.getLoc();
@ -648,7 +648,7 @@ public:
explicit ParentComponentOpConversion(mlir::MLIRContext *ctx)
: OpRewritePattern{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::ParentComponentOp parentComponent,
mlir::PatternRewriter &rewriter) const override {
mlir::Location loc = parentComponent.getLoc();
@ -696,7 +696,7 @@ public:
explicit NoReassocOpConversion(mlir::MLIRContext *ctx)
: OpRewritePattern{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::NoReassocOp noreassoc,
mlir::PatternRewriter &rewriter) const override {
rewriter.replaceOpWithNewOp<fir::NoReassocOp>(noreassoc,
@ -709,7 +709,7 @@ class NullOpConversion : public mlir::OpRewritePattern<hlfir::NullOp> {
public:
explicit NullOpConversion(mlir::MLIRContext *ctx) : OpRewritePattern{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::NullOp nullop,
mlir::PatternRewriter &rewriter) const override {
rewriter.replaceOpWithNewOp<fir::ZeroOp>(nullop, nullop.getType());
@ -722,7 +722,7 @@ class GetExtentOpConversion
public:
using mlir::OpRewritePattern<hlfir::GetExtentOp>::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::GetExtentOp getExtentOp,
mlir::PatternRewriter &rewriter) const override {
mlir::Value shape = getExtentOp.getShape();

View File

@ -73,7 +73,7 @@ class InlineElementalConversion
public:
using mlir::OpRewritePattern<hlfir::ElementalOp>::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::ElementalOp elemental,
mlir::PatternRewriter &rewriter) const override {
std::optional<std::pair<hlfir::ApplyOp, hlfir::DestroyOp>> maybeTuple =

View File

@ -22,7 +22,6 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include <optional>
@ -235,7 +234,7 @@ protected:
};
public:
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(OP operation,
mlir::PatternRewriter &rewriter) const override {
std::string opName;
@ -311,7 +310,7 @@ using AllOpConversion = HlfirReductionIntrinsicConversion<hlfir::AllOp>;
struct CountOpConversion : public HlfirIntrinsicConversion<hlfir::CountOp> {
using HlfirIntrinsicConversion<hlfir::CountOp>::HlfirIntrinsicConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::CountOp count,
mlir::PatternRewriter &rewriter) const override {
fir::FirOpBuilder builder{rewriter, count.getOperation()};
@ -345,7 +344,7 @@ struct CountOpConversion : public HlfirIntrinsicConversion<hlfir::CountOp> {
struct MatmulOpConversion : public HlfirIntrinsicConversion<hlfir::MatmulOp> {
using HlfirIntrinsicConversion<hlfir::MatmulOp>::HlfirIntrinsicConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::MatmulOp matmul,
mlir::PatternRewriter &rewriter) const override {
fir::FirOpBuilder builder{rewriter, matmul.getOperation()};
@ -376,7 +375,7 @@ struct DotProductOpConversion
: public HlfirIntrinsicConversion<hlfir::DotProductOp> {
using HlfirIntrinsicConversion<hlfir::DotProductOp>::HlfirIntrinsicConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::DotProductOp dotProduct,
mlir::PatternRewriter &rewriter) const override {
fir::FirOpBuilder builder{rewriter, dotProduct.getOperation()};
@ -407,7 +406,7 @@ class TransposeOpConversion
: public HlfirIntrinsicConversion<hlfir::TransposeOp> {
using HlfirIntrinsicConversion<hlfir::TransposeOp>::HlfirIntrinsicConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::TransposeOp transpose,
mlir::PatternRewriter &rewriter) const override {
fir::FirOpBuilder builder{rewriter, transpose.getOperation()};
@ -437,7 +436,7 @@ struct MatmulTransposeOpConversion
using HlfirIntrinsicConversion<
hlfir::MatmulTransposeOp>::HlfirIntrinsicConversion;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::MatmulTransposeOp multranspose,
mlir::PatternRewriter &rewriter) const override {
fir::FirOpBuilder builder{rewriter, multranspose.getOperation()};

View File

@ -1309,7 +1309,7 @@ static void lower(hlfir::OrderedAssignmentTreeOpInterface root,
/// Shared rewrite entry point for all the ordered assignment tree root
/// operations. It calls the scheduler and then apply the schedule.
static mlir::LogicalResult rewrite(hlfir::OrderedAssignmentTreeOpInterface root,
static llvm::LogicalResult rewrite(hlfir::OrderedAssignmentTreeOpInterface root,
bool tryFusingAssignments,
mlir::PatternRewriter &rewriter) {
hlfir::Schedule schedule =
@ -1337,7 +1337,7 @@ public:
explicit ForallOpConversion(mlir::MLIRContext *ctx, bool tryFusingAssignments)
: OpRewritePattern{ctx}, tryFusingAssignments{tryFusingAssignments} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::ForallOp forallOp,
mlir::PatternRewriter &rewriter) const override {
auto root = mlir::cast<hlfir::OrderedAssignmentTreeOpInterface>(
@ -1354,7 +1354,7 @@ public:
explicit WhereOpConversion(mlir::MLIRContext *ctx, bool tryFusingAssignments)
: OpRewritePattern{ctx}, tryFusingAssignments{tryFusingAssignments} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::WhereOp whereOp,
mlir::PatternRewriter &rewriter) const override {
auto root = mlir::cast<hlfir::OrderedAssignmentTreeOpInterface>(
@ -1370,7 +1370,7 @@ public:
explicit RegionAssignConversion(mlir::MLIRContext *ctx)
: OpRewritePattern{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::RegionAssignOp regionAssignOp,
mlir::PatternRewriter &rewriter) const override {
auto root = mlir::cast<hlfir::OrderedAssignmentTreeOpInterface>(

View File

@ -89,7 +89,7 @@ private:
public:
using mlir::OpRewritePattern<hlfir::ElementalOp>::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::ElementalOp elemental,
mlir::PatternRewriter &rewriter) const override;
};
@ -465,7 +465,7 @@ ElementalAssignBufferization::findMatch(hlfir::ElementalOp elemental) {
return match;
}
mlir::LogicalResult ElementalAssignBufferization::matchAndRewrite(
llvm::LogicalResult ElementalAssignBufferization::matchAndRewrite(
hlfir::ElementalOp elemental, mlir::PatternRewriter &rewriter) const {
std::optional<MatchInfo> match = findMatch(elemental);
if (!match)
@ -519,12 +519,12 @@ private:
public:
using mlir::OpRewritePattern<hlfir::AssignOp>::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::AssignOp assign,
mlir::PatternRewriter &rewriter) const override;
};
mlir::LogicalResult BroadcastAssignBufferization::matchAndRewrite(
llvm::LogicalResult BroadcastAssignBufferization::matchAndRewrite(
hlfir::AssignOp assign, mlir::PatternRewriter &rewriter) const {
// Since RHS is a scalar and LHS is an array, LHS must be allocated
// in a conforming Fortran program, and LHS cannot be reallocated
@ -587,12 +587,12 @@ private:
public:
using mlir::OpRewritePattern<hlfir::AssignOp>::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::AssignOp assign,
mlir::PatternRewriter &rewriter) const override;
};
mlir::LogicalResult VariableAssignBufferization::matchAndRewrite(
llvm::LogicalResult VariableAssignBufferization::matchAndRewrite(
hlfir::AssignOp assign, mlir::PatternRewriter &rewriter) const {
if (assign.isAllocatableAssignment())
return rewriter.notifyMatchFailure(assign, "AssignOp may imply allocation");
@ -716,7 +716,7 @@ class ReductionElementalConversion : public mlir::OpRewritePattern<Op> {
public:
using mlir::OpRewritePattern<Op>::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(Op op, mlir::PatternRewriter &rewriter) const override {
mlir::Location loc = op.getLoc();
hlfir::ElementalOp elemental =
@ -817,7 +817,7 @@ class MinMaxlocElementalConversion : public mlir::OpRewritePattern<Op> {
public:
using mlir::OpRewritePattern<Op>::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(Op mloc, mlir::PatternRewriter &rewriter) const override {
if (!mloc.getMask() || mloc.getDim() || mloc.getBack())
return rewriter.notifyMatchFailure(mloc,

View File

@ -35,7 +35,7 @@ class TransposeAsElementalConversion
public:
using mlir::OpRewritePattern<hlfir::TransposeOp>::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(hlfir::TransposeOp transpose,
mlir::PatternRewriter &rewriter) const override {
mlir::Location loc = transpose.getLoc();

View File

@ -84,7 +84,7 @@ public:
CallConversion(mlir::MLIRContext *context, bool shouldBoxResult)
: OpRewritePattern<Op>(context, 1), shouldBoxResult{shouldBoxResult} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(Op op, mlir::PatternRewriter &rewriter) const override {
auto loc = op.getLoc();
auto result = op->getResult(0);
@ -192,7 +192,7 @@ public:
using OpRewritePattern::OpRewritePattern;
SaveResultOpConversion(mlir::MLIRContext *context)
: OpRewritePattern(context) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::SaveResultOp op,
mlir::PatternRewriter &rewriter) const override {
rewriter.eraseOp(op);
@ -205,7 +205,7 @@ public:
using OpRewritePattern::OpRewritePattern;
ReturnOpConversion(mlir::MLIRContext *context, mlir::Value newArg)
: OpRewritePattern(context), newArg{newArg} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(mlir::func::ReturnOp ret,
mlir::PatternRewriter &rewriter) const override {
auto loc = ret.getLoc();
@ -258,7 +258,7 @@ public:
using OpRewritePattern::OpRewritePattern;
AddrOfOpConversion(mlir::MLIRContext *context, bool shouldBoxResult)
: OpRewritePattern(context), shouldBoxResult{shouldBoxResult} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::AddrOfOp addrOf,
mlir::PatternRewriter &rewriter) const override {
auto oldFuncTy = mlir::cast<mlir::FunctionType>(addrOf.getType());
@ -432,4 +432,4 @@ public:
};
} // end anonymous namespace
} // namespace fir
} // namespace fir

View File

@ -95,7 +95,7 @@ public:
class ConvertConversion : public mlir::OpRewritePattern<fir::ConvertOp> {
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::ConvertOp op,
mlir::PatternRewriter &rewriter) const override {
if (mlir::isa<mlir::MemRefType>(op.getRes().getType())) {
@ -133,7 +133,7 @@ mlir::Type convertMemRef(mlir::MemRefType type) {
class StdAllocConversion : public mlir::OpRewritePattern<memref::AllocOp> {
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(memref::AllocOp op,
mlir::PatternRewriter &rewriter) const override {
rewriter.replaceOpWithNewOp<fir::AllocaOp>(op, convertMemRef(op.getType()),

View File

@ -453,7 +453,7 @@ public:
AffineLoopConversion(mlir::MLIRContext *context, AffineFunctionAnalysis &afa)
: OpRewritePattern(context), functionAnalysis(afa) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::DoLoopOp loop,
mlir::PatternRewriter &rewriter) const override {
LLVM_DEBUG(llvm::dbgs() << "AffineLoopConversion: rewriting loop:\n";
@ -546,7 +546,7 @@ public:
using OpRewritePattern::OpRewritePattern;
AffineIfConversion(mlir::MLIRContext *context, AffineFunctionAnalysis &afa)
: OpRewritePattern(context) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::IfOp op,
mlir::PatternRewriter &rewriter) const override {
LLVM_DEBUG(llvm::dbgs() << "AffineIfConversion: rewriting if:\n";

View File

@ -796,7 +796,7 @@ class ArrayLoadConversion : public mlir::OpRewritePattern<ArrayLoadOp> {
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(ArrayLoadOp load,
mlir::PatternRewriter &rewriter) const override {
LLVM_DEBUG(llvm::dbgs() << "replace load " << load << " with undef.\n");
@ -810,7 +810,7 @@ class ArrayMergeStoreConversion
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(ArrayMergeStoreOp store,
mlir::PatternRewriter &rewriter) const override {
LLVM_DEBUG(llvm::dbgs() << "marking store " << store << " as dead.\n");
@ -1248,7 +1248,7 @@ public:
const OperationUseMapT &m)
: ArrayUpdateConversionBase{ctx, a, m} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(ArrayUpdateOp update,
mlir::PatternRewriter &rewriter) const override {
auto loc = update.getLoc();
@ -1276,7 +1276,7 @@ public:
const OperationUseMapT &m)
: ArrayUpdateConversionBase{ctx, a, m} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(ArrayModifyOp modify,
mlir::PatternRewriter &rewriter) const override {
auto loc = modify.getLoc();
@ -1298,7 +1298,7 @@ public:
const OperationUseMapT &m)
: OpRewritePattern{ctx}, useMap{m} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(ArrayFetchOp fetch,
mlir::PatternRewriter &rewriter) const override {
auto *op = fetch.getOperation();
@ -1329,7 +1329,7 @@ public:
const OperationUseMapT &m)
: ArrayUpdateConversionBase{ctx, a, m} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(ArrayAccessOp access,
mlir::PatternRewriter &rewriter) const override {
auto *op = access.getOperation();
@ -1362,7 +1362,7 @@ public:
explicit ArrayAmendConversion(mlir::MLIRContext *ctx)
: OpRewritePattern{ctx} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(ArrayAmendOp amend,
mlir::PatternRewriter &rewriter) const override {
auto *op = amend.getOperation();

View File

@ -63,7 +63,7 @@ public:
: mlir::OpRewritePattern<fir::ReboxAssumedRankOp>(context),
symbolTable{symbolTable}, kindMap{kindMap} {};
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::ReboxAssumedRankOp rebox,
mlir::PatternRewriter &rewriter) const override {
fir::FirOpBuilder builder{rewriter, kindMap, symbolTable};
@ -123,7 +123,7 @@ public:
: mlir::OpRewritePattern<fir::IsAssumedSizeOp>(context),
symbolTable{symbolTable}, kindMap{kindMap} {};
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::IsAssumedSizeOp isAssumedSizeOp,
mlir::PatternRewriter &rewriter) const override {
fir::FirOpBuilder builder{rewriter, kindMap, symbolTable};

View File

@ -38,7 +38,7 @@ class CharacterConvertConversion
public:
using OpRewritePattern::OpRewritePattern;
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::CharConvertOp conv,
mlir::PatternRewriter &rewriter) const override {
auto kindMap = fir::getKindMapping(conv->getParentOfType<mlir::ModuleOp>());

View File

@ -37,7 +37,7 @@ public:
CallOpRewriter(mlir::MLIRContext *ctx, const mlir::DominanceInfo &_di)
: OpRewritePattern(ctx), di(_di) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::CallOp callOp,
mlir::PatternRewriter &rewriter) const override {
LLVM_DEBUG(llvm::dbgs() << "Processing call op: " << callOp << "\n");

View File

@ -47,7 +47,7 @@ public:
: mlir::OpRewritePattern<fir::DoLoopOp>(ctx),
forceLoopToExecuteOnce(forceLoopToExecuteOnce), setNSW(setNSW) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(DoLoopOp loop,
mlir::PatternRewriter &rewriter) const override {
auto loc = loop.getLoc();
@ -162,7 +162,7 @@ public:
CfgIfConv(mlir::MLIRContext *ctx, bool forceLoopToExecuteOnce, bool setNSW)
: mlir::OpRewritePattern<fir::IfOp>(ctx) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(IfOp ifOp, mlir::PatternRewriter &rewriter) const override {
auto loc = ifOp.getLoc();
@ -228,7 +228,7 @@ public:
bool setNSW)
: mlir::OpRewritePattern<fir::IterWhileOp>(ctx), setNSW(setNSW) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::IterWhileOp whileOp,
mlir::PatternRewriter &rewriter) const override {
auto loc = whileOp.getLoc();

View File

@ -100,7 +100,7 @@ public:
llvm::ArrayRef<mlir::Operation *> rets)
: OpRewritePattern(ctx), returnOps(rets) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::AllocaOp alloca,
mlir::PatternRewriter &rewriter) const override {
auto loc = alloca.getLoc();

View File

@ -50,7 +50,7 @@ public:
SelectTypeConv(mlir::MLIRContext *ctx)
: mlir::OpConversionPattern<fir::SelectTypeOp>(ctx) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::SelectTypeOp selectType, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override;
@ -60,7 +60,7 @@ private:
mlir::Type ty, mlir::ModuleOp mod,
mlir::PatternRewriter &rewriter) const;
mlir::LogicalResult genTypeLadderStep(mlir::Location loc,
llvm::LogicalResult genTypeLadderStep(mlir::Location loc,
mlir::Value selector,
mlir::Attribute attr, mlir::Block *dest,
std::optional<mlir::ValueRange> destOps,
@ -81,7 +81,7 @@ struct DispatchOpConv : public OpConversionPattern<fir::DispatchOp> {
: mlir::OpConversionPattern<fir::DispatchOp>(ctx),
bindingTables(bindingTables) {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::DispatchOp dispatch, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
mlir::Location loc = dispatch.getLoc();
@ -135,7 +135,7 @@ struct DispatchOpConv : public OpConversionPattern<fir::DispatchOp> {
// %18 = fir.field_index proc, !fir.type<_QM__fortran_type_infoTbinding>
// %19 = fir.coordinate_of %17, %18 : (!fir.ref<!fir.type<_QM__fortran_type_infoTbinding>>, !fir.field) -> !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_funptr>>
// %20 = fir.field_index __address, !fir.type<_QM__fortran_builtinsT__builtin_c_funptr>
// %21 = fir.coordinate_of %19, %20 : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_funptr>>, !fir.field) -> !fir.ref<i64>
// %21 = fir.coordinate_of %19, %20 : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_funptr>>, !fir.field) -> !fir.ref<i64>
// %22 = fir.load %21 : !fir.ref<i64>
// %23 = fir.convert %22 : (i64) -> (() -> ())
// fir.call %23() : () -> ()
@ -217,7 +217,7 @@ private:
class PolymorphicOpConversion
: public fir::impl::PolymorphicOpConversionBase<PolymorphicOpConversion> {
public:
mlir::LogicalResult initialize(mlir::MLIRContext *ctx) override {
llvm::LogicalResult initialize(mlir::MLIRContext *ctx) override {
return mlir::success();
}
@ -250,7 +250,7 @@ public:
};
} // namespace
mlir::LogicalResult SelectTypeConv::matchAndRewrite(
llvm::LogicalResult SelectTypeConv::matchAndRewrite(
fir::SelectTypeOp selectType, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const {
auto operands = adaptor.getOperands();
@ -341,7 +341,7 @@ mlir::LogicalResult SelectTypeConv::matchAndRewrite(
return mlir::success();
}
mlir::LogicalResult SelectTypeConv::genTypeLadderStep(
llvm::LogicalResult SelectTypeConv::genTypeLadderStep(
mlir::Location loc, mlir::Value selector, mlir::Attribute attr,
mlir::Block *dest, std::optional<mlir::ValueRange> destOps,
mlir::ModuleOp mod, mlir::PatternRewriter &rewriter,

View File

@ -25,7 +25,6 @@
#include "mlir/IR/Value.h"
#include "mlir/Interfaces/LoopLikeInterface.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "mlir/Transforms/Passes.h"
#include "llvm/ADT/DenseMap.h"
@ -180,7 +179,7 @@ public:
private:
llvm::DenseMap<mlir::Operation *, AllocMemMap> funcMaps;
mlir::LogicalResult analyseFunction(mlir::Operation *func);
llvm::LogicalResult analyseFunction(mlir::Operation *func);
};
/// Converts a fir.allocmem to a fir.alloca
@ -191,7 +190,7 @@ public:
const StackArraysAnalysisWrapper::AllocMemMap &candidateOps)
: OpRewritePattern(ctx), candidateOps{candidateOps} {}
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(fir::AllocMemOp allocmem,
mlir::PatternRewriter &rewriter) const override;
@ -415,7 +414,7 @@ void AllocationAnalysis::processOperation(mlir::Operation *op) {
visitOperationImpl(op, *before, after);
}
mlir::LogicalResult
llvm::LogicalResult
StackArraysAnalysisWrapper::analyseFunction(mlir::Operation *func) {
assert(mlir::isa<mlir::func::FuncOp>(func));
size_t nAllocs = 0;
@ -507,7 +506,7 @@ static mlir::Value convertAllocationType(mlir::PatternRewriter &rewriter,
return conv;
}
mlir::LogicalResult
llvm::LogicalResult
AllocMemConversion::matchAndRewrite(fir::AllocMemOp allocmem,
mlir::PatternRewriter &rewriter) const {
auto oldInsertionPt = rewriter.saveInsertionPoint();

View File

@ -269,7 +269,7 @@ createTargetMachine(llvm::StringRef targetTriple, std::string &error) {
/// of the pass manager, allowing it to be invoked as soon as it's
/// required without impacting the main pass pipeline that may be invoked
/// more than once for verification.
static mlir::LogicalResult runOpenMPPasses(mlir::ModuleOp mlirModule) {
static llvm::LogicalResult runOpenMPPasses(mlir::ModuleOp mlirModule) {
mlir::PassManager pm(mlirModule->getName(),
mlir::OpPassManager::Nesting::Implicit);
fir::createOpenMPFIRPassPipeline(pm, enableOpenMPDevice);
@ -285,7 +285,7 @@ static mlir::LogicalResult runOpenMPPasses(mlir::ModuleOp mlirModule) {
// Translate Fortran input to FIR, a dialect of MLIR.
//===----------------------------------------------------------------------===//
static mlir::LogicalResult convertFortranSourceToMLIR(
static llvm::LogicalResult convertFortranSourceToMLIR(
std::string path, Fortran::parser::Options options,
const ProgramName &programPrefix,
Fortran::semantics::SemanticsContext &semanticsContext,

View File

@ -74,7 +74,7 @@ static void printModule(mlir::ModuleOp mod, raw_ostream &output) {
}
// compile a .fir file
static mlir::LogicalResult
static llvm::LogicalResult
compileFIR(const mlir::PassPipelineCLParser &passPipeline) {
// check that there is a file to load
ErrorOr<std::unique_ptr<MemoryBuffer>> fileOrErr =

View File

@ -0,0 +1,128 @@
//===- LogicalResult.h - Utilities for handling success/failure -*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_SUPPORT_LOGICALRESULT_H
#define LLVM_SUPPORT_LOGICALRESULT_H
#include <cassert>
#include <optional>
namespace llvm {
/// This class represents an efficient way to signal success or failure. It
/// should be preferred over the use of `bool` when appropriate, as it avoids
/// all of the ambiguity that arises in interpreting a boolean result. This
/// class is marked as NODISCARD to ensure that the result is processed. Users
/// may explicitly discard a result by using `(void)`, e.g.
/// `(void)functionThatReturnsALogicalResult();`. Given the intended nature of
/// this class, it generally shouldn't be used as the result of functions that
/// very frequently have the result ignored. This class is intended to be used
/// in conjunction with the utility functions below.
struct [[nodiscard]] LogicalResult {
public:
/// If isSuccess is true a `success` result is generated, otherwise a
/// 'failure' result is generated.
static LogicalResult success(bool IsSuccess = true) {
return LogicalResult(IsSuccess);
}
/// If isFailure is true a `failure` result is generated, otherwise a
/// 'success' result is generated.
static LogicalResult failure(bool IsFailure = true) {
return LogicalResult(!IsFailure);
}
/// Returns true if the provided LogicalResult corresponds to a success value.
constexpr bool succeeded() const { return IsSuccess; }
/// Returns true if the provided LogicalResult corresponds to a failure value.
constexpr bool failed() const { return !IsSuccess; }
private:
LogicalResult(bool IsSuccess) : IsSuccess(IsSuccess) {}
/// Boolean indicating if this is a success result, if false this is a
/// failure result.
bool IsSuccess;
};
/// Utility function to generate a LogicalResult. If isSuccess is true a
/// `success` result is generated, otherwise a 'failure' result is generated.
inline LogicalResult success(bool IsSuccess = true) {
return LogicalResult::success(IsSuccess);
}
/// Utility function to generate a LogicalResult. If isFailure is true a
/// `failure` result is generated, otherwise a 'success' result is generated.
inline LogicalResult failure(bool IsFailure = true) {
return LogicalResult::failure(IsFailure);
}
/// Utility function that returns true if the provided LogicalResult corresponds
/// to a success value.
inline bool succeeded(LogicalResult Result) { return Result.succeeded(); }
/// Utility function that returns true if the provided LogicalResult corresponds
/// to a failure value.
inline bool failed(LogicalResult Result) { return Result.failed(); }
/// This class provides support for representing a failure result, or a valid
/// value of type `T`. This allows for integrating with LogicalResult, while
/// also providing a value on the success path.
template <typename T> class [[nodiscard]] FailureOr : public std::optional<T> {
public:
/// Allow constructing from a LogicalResult. The result *must* be a failure.
/// Success results should use a proper instance of type `T`.
FailureOr(LogicalResult Result) {
assert(failed(Result) &&
"success should be constructed with an instance of 'T'");
}
FailureOr() : FailureOr(failure()) {}
FailureOr(T &&Y) : std::optional<T>(std::forward<T>(Y)) {}
FailureOr(const T &Y) : std::optional<T>(Y) {}
template <typename U,
std::enable_if_t<std::is_constructible<T, U>::value> * = nullptr>
FailureOr(const FailureOr<U> &Other)
: std::optional<T>(failed(Other) ? std::optional<T>()
: std::optional<T>(*Other)) {}
operator LogicalResult() const { return success(has_value()); }
private:
/// Hide the bool conversion as it easily creates confusion.
using std::optional<T>::operator bool;
using std::optional<T>::has_value;
};
/// Wrap a value on the success path in a FailureOr of the same value type.
template <typename T,
typename = std::enable_if_t<!std::is_convertible_v<T, bool>>>
inline auto success(T &&Y) {
return FailureOr<std::decay_t<T>>(std::forward<T>(Y));
}
/// This class represents success/failure for parsing-like operations that find
/// it important to chain together failable operations with `||`. This is an
/// extended version of `LogicalResult` that allows for explicit conversion to
/// bool.
///
/// This class should not be used for general error handling cases - we prefer
/// to keep the logic explicit with the `succeeded`/`failed` predicates.
/// However, traditional monadic-style parsing logic can sometimes get
/// swallowed up in boilerplate without this, so we provide this for narrow
/// cases where it is important.
///
class [[nodiscard]] ParseResult : public LogicalResult {
public:
ParseResult(LogicalResult Result = success()) : LogicalResult(Result) {}
/// Failure is true in a boolean context.
constexpr explicit operator bool() const { return failed(); }
};
} // namespace llvm
#endif // LLVM_SUPPORT_LOGICALRESULT_H

View File

@ -277,7 +277,7 @@ Pattern {
// * Match Section
// - Describes the input IR.
let root = op<toy.reshape>(op<toy.reshape>(arg: Value));
// * Rewrite Section
// - Describes how to transform the IR.
// - Last statement starts the rewrite.
@ -1009,7 +1009,7 @@ Pattern {
// Return a tuple of values.
let result = ExtractMultipleResults(op: op<my_dialect.foo>);
// Index the tuple elements by index, or by name.
// Index the tuple elements by index, or by name.
replace op<my_dialect.foo> with (result.0, result.1, result.result1);
}
```
@ -1150,7 +1150,7 @@ same name. See the ["type translation"](#native-constraint-type-translations) be
detailed information on how PDLL types are converted to native types. In addition to the
PDLL arguments, the code block may also access the current `PatternRewriter` using
`rewriter`. The result type of the native constraint function is implicitly defined
as a `::mlir::LogicalResult`.
as a `::llvm::LogicalResult`.
Taking the constraints defined above as an example, these function would roughly be
translated into:
@ -1220,7 +1220,7 @@ was imported:
* `Attr` constraints
- Imported `Attr` constraints utilize the `storageType` field for native type translation.
* `Type` constraints
- Imported `Type` constraints utilize the `cppClassName` field for native type translation.
@ -1310,7 +1310,7 @@ Pattern {
// A pattern that replaces the root operation with another operation.
// Note that when an operation is used as the replacement, we can infer its
// result types from the input operation. In these cases, the result
// types of replacement operation may be elided.
// types of replacement operation may be elided.
Pattern {
// Note: In this pattern we also inlined the `root` expression.
replace op<my_dialect.foo> with op<my_dialect.bar>;
@ -1385,7 +1385,7 @@ Pattern {
// Invoke the rewrite, which returns a tuple of values.
let result = CreateRewriteOps();
// Index the tuple elements by index, or by name.
// Index the tuple elements by index, or by name.
replace root with (result.0, result.1, result.result1);
}
}
@ -1466,7 +1466,7 @@ the C++ PDL API. For example, the rewrite above may be registered as:
```c++
static Operation *buildOpImpl(PDLResultList &results, Value value) {
// insert special rewrite logic here.
Operation *resultOp = ...;
Operation *resultOp = ...;
return resultOp;
}

View File

@ -243,7 +243,7 @@ operation. This operation will represent a constant value in the Toy language.
This operation takes zero operands, a
[dense elements](../../Dialects/Builtin.md/#denseintorfpelementsattr) attribute named
`value` to represent the constant value, and returns a single result of
[RankedTensorType](../../Dialects/Builtin.md/#rankedtensortype). An operation class
[RankedTensorType](../../Dialects/Builtin.md/#rankedtensortype). An operation class
inherits from the [CRTP](https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern)
`mlir::Op` class which also takes some optional [*traits*](../../Traits) to
customize its behavior. `Traits` are a mechanism with which we can inject
@ -497,10 +497,10 @@ def ConstantOp : Toy_Op<"constant"> {
let results = (outs F64Tensor);
// Add additional verification logic to the constant operation. Setting this bit
// to `1` will generate a `::mlir::LogicalResult verify()` declaration on the
// to `1` will generate a `::llvm::LogicalResult verify()` declaration on the
// operation class that is called after ODS constructs have been verified, for
// example the types of arguments and results. We implement additional verification
// in the definition of this `verify` method in the C++ source file.
// in the definition of this `verify` method in the C++ source file.
let hasVerifier = 1;
}
```

View File

@ -86,7 +86,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// This method is attempting to match a pattern and rewrite it. The rewriter
/// argument is the orchestrator of the sequence of rewrites. It is expected
/// to interact with it to perform any changes to the IR from here.
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(TransposeOp op,
mlir::PatternRewriter &rewriter) const override {
// Look through the input of the current transpose.
@ -128,7 +128,7 @@ similar way to LLVM:
pm.addNestedPass<mlir::toy::FuncOp>(mlir::createCanonicalizerPass());
```
Finally, we can run `toyc-ch3 test/Examples/Toy/Ch3/transpose_transpose.toy
Finally, we can run `toyc-ch3 test/Examples/Toy/Ch3/transpose_transpose.toy
-emit=mlir -opt` and observe our pattern in action:
```mlir
@ -239,7 +239,7 @@ module {
}
```
We can try to run `toyc-ch3 test/Examples/Toy/Ch3/trivial_reshape.toy -emit=mlir
We can try to run `toyc-ch3 test/Examples/Toy/Ch3/trivial_reshape.toy -emit=mlir
-opt` and observe our pattern in action:
```mlir

View File

@ -113,7 +113,7 @@ struct TransposeOpLowering : public mlir::ConversionPattern {
/// Match and rewrite the given `toy.transpose` operation, with the given
/// operands that have been remapped from `tensor<...>` to `memref<...>`.
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(mlir::Operation *op, ArrayRef<mlir::Value> operands,
mlir::ConversionPatternRewriter &rewriter) const final {
auto loc = op->getLoc();

View File

@ -8,7 +8,6 @@
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Rewrite/FrozenRewritePatternSet.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "Standalone/StandalonePasses.h"

View File

@ -15,7 +15,6 @@
#include "mlir/IR/DialectRegistry.h"
#include "mlir/IR/Operation.h"
#include "mlir/InitAllTranslations.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Tools/mlir-translate/MlirTranslateMain.h"
#include "mlir/Tools/mlir-translate/Translation.h"
#include "llvm/Support/raw_ostream.h"
@ -27,7 +26,7 @@ int main(int argc, char **argv) {
mlir::TranslateFromMLIRRegistration withdescription(
"option", "different from option",
[](mlir::Operation *op, llvm::raw_ostream &output) {
return mlir::LogicalResult::success();
return llvm::LogicalResult::success();
},
[](mlir::DialectRegistry &a) {});

View File

@ -22,7 +22,6 @@
#include "mlir/IR/Value.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
@ -142,7 +141,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
/// Verifier for the constant operation. This corresponds to the
/// `let hasVerifier = 1` in the op definition.
mlir::LogicalResult ConstantOp::verify() {
llvm::LogicalResult ConstantOp::verify() {
// If the return type of the constant is not an unranked tensor, the shape
// must match the shape of the attribute holding the data.
auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
@ -257,7 +256,7 @@ void MulOp::print(mlir::OpAsmPrinter &p) { printBinaryOp(p, *this); }
// ReturnOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult ReturnOp::verify() {
llvm::LogicalResult ReturnOp::verify() {
// We know that the parent operation is a function, because of the 'HasParent'
// trait attached to the operation definition.
auto function = cast<FuncOp>((*this)->getParentOp());
@ -300,7 +299,7 @@ void TransposeOp::build(mlir::OpBuilder &builder, mlir::OperationState &state,
state.addOperands(value);
}
mlir::LogicalResult TransposeOp::verify() {
llvm::LogicalResult TransposeOp::verify() {
auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
if (!inputType || !resultType)

View File

@ -15,7 +15,6 @@
#include "mlir/IR/Block.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
@ -105,7 +104,7 @@ private:
/// Declare a variable in the current scope, return success if the variable
/// wasn't declared yet.
mlir::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
llvm::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
if (symbolTable.count(var))
return mlir::failure();
symbolTable.insert(var, value);
@ -225,7 +224,7 @@ private:
}
/// Emit a return operation. This will return failure if any generation fails.
mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
auto location = loc(ret.loc());
// 'return' takes an optional expression, handle that case here.
@ -337,7 +336,7 @@ private:
/// Emit a print expression. It emits specific operations for two builtins:
/// transpose(x) and print(x).
mlir::LogicalResult mlirGen(PrintExprAST &call) {
llvm::LogicalResult mlirGen(PrintExprAST &call) {
auto arg = mlirGen(*call.getArg());
if (!arg)
return mlir::failure();
@ -403,7 +402,7 @@ private:
}
/// Codegen a list of expression, return failure if one of them hit an error.
mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
ScopedHashTableScope<StringRef, mlir::Value> varScope(symbolTable);
for (auto &expr : blockAST) {
// Specific handling for variable declarations, return statement, and

View File

@ -22,7 +22,6 @@
#include "mlir/IR/Value.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
@ -142,7 +141,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
/// Verifier for the constant operation. This corresponds to the
/// `let hasVerifier = 1` in the op definition.
mlir::LogicalResult ConstantOp::verify() {
llvm::LogicalResult ConstantOp::verify() {
// If the return type of the constant is not an unranked tensor, the shape
// must match the shape of the attribute holding the data.
auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
@ -257,7 +256,7 @@ void MulOp::print(mlir::OpAsmPrinter &p) { printBinaryOp(p, *this); }
// ReturnOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult ReturnOp::verify() {
llvm::LogicalResult ReturnOp::verify() {
// We know that the parent operation is a function, because of the 'HasParent'
// trait attached to the operation definition.
auto function = cast<FuncOp>((*this)->getParentOp());
@ -300,7 +299,7 @@ void TransposeOp::build(mlir::OpBuilder &builder, mlir::OperationState &state,
state.addOperands(value);
}
mlir::LogicalResult TransposeOp::verify() {
llvm::LogicalResult TransposeOp::verify() {
auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
if (!inputType || !resultType)

View File

@ -15,7 +15,6 @@
#include "mlir/IR/Block.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
@ -105,7 +104,7 @@ private:
/// Declare a variable in the current scope, return success if the variable
/// wasn't declared yet.
mlir::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
llvm::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
if (symbolTable.count(var))
return mlir::failure();
symbolTable.insert(var, value);
@ -225,7 +224,7 @@ private:
}
/// Emit a return operation. This will return failure if any generation fails.
mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
auto location = loc(ret.loc());
// 'return' takes an optional expression, handle that case here.
@ -337,7 +336,7 @@ private:
/// Emit a print expression. It emits specific operations for two builtins:
/// transpose(x) and print(x).
mlir::LogicalResult mlirGen(PrintExprAST &call) {
llvm::LogicalResult mlirGen(PrintExprAST &call) {
auto arg = mlirGen(*call.getArg());
if (!arg)
return mlir::failure();
@ -403,7 +402,7 @@ private:
}
/// Codegen a list of expression, return failure if one of them hit an error.
mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
ScopedHashTableScope<StringRef, mlir::Value> varScope(symbolTable);
for (auto &expr : blockAST) {
// Specific handling for variable declarations, return statement, and

View File

@ -14,7 +14,6 @@
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/Dialect.h"
using namespace mlir;
using namespace toy;
@ -36,7 +35,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// This method attempts to match a pattern and rewrite it. The rewriter
/// argument is the orchestrator of the sequence of rewrites. The pattern is
/// expected to interact with it to perform any changes to the IR from here.
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(TransposeOp op,
mlir::PatternRewriter &rewriter) const override {
// Look through the input of the current transpose.

View File

@ -11,7 +11,6 @@
//===----------------------------------------------------------------------===//
#include "mlir/IR/Diagnostics.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
#include "toy/Lexer.h"

View File

@ -23,7 +23,6 @@
#include "mlir/Interfaces/CallInterfaces.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/InliningUtils.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
@ -204,7 +203,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
/// Verifier for the constant operation. This corresponds to the
/// `let hasVerifier = 1` in the op definition.
mlir::LogicalResult ConstantOp::verify() {
llvm::LogicalResult ConstantOp::verify() {
// If the return type of the constant is not an unranked tensor, the shape
// must match the shape of the attribute holding the data.
auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
@ -372,7 +371,7 @@ void MulOp::inferShapes() { getResult().setType(getLhs().getType()); }
// ReturnOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult ReturnOp::verify() {
llvm::LogicalResult ReturnOp::verify() {
// We know that the parent operation is a function, because of the 'HasParent'
// trait attached to the operation definition.
auto function = cast<FuncOp>((*this)->getParentOp());
@ -421,7 +420,7 @@ void TransposeOp::inferShapes() {
getResult().setType(RankedTensorType::get(dims, arrayTy.getElementType()));
}
mlir::LogicalResult TransposeOp::verify() {
llvm::LogicalResult TransposeOp::verify() {
auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
if (!inputType || !resultType)

View File

@ -15,7 +15,6 @@
#include "mlir/IR/Block.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
@ -105,7 +104,7 @@ private:
/// Declare a variable in the current scope, return success if the variable
/// wasn't declared yet.
mlir::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
llvm::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
if (symbolTable.count(var))
return mlir::failure();
symbolTable.insert(var, value);
@ -229,7 +228,7 @@ private:
}
/// Emit a return operation. This will return failure if any generation fails.
mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
auto location = loc(ret.loc());
// 'return' takes an optional expression, handle that case here.
@ -341,7 +340,7 @@ private:
/// Emit a print expression. It emits specific operations for two builtins:
/// transpose(x) and print(x).
mlir::LogicalResult mlirGen(PrintExprAST &call) {
llvm::LogicalResult mlirGen(PrintExprAST &call) {
auto arg = mlirGen(*call.getArg());
if (!arg)
return mlir::failure();
@ -407,7 +406,7 @@ private:
}
/// Codegen a list of expression, return failure if one of them hit an error.
mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
ScopedHashTableScope<StringRef, mlir::Value> varScope(symbolTable);
for (auto &expr : blockAST) {
// Specific handling for variable declarations, return statement, and

View File

@ -14,7 +14,6 @@
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/Dialect.h"
using namespace mlir;
using namespace toy;
@ -36,7 +35,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// This method attempts to match a pattern and rewrite it. The rewriter
/// argument is the orchestrator of the sequence of rewrites. The pattern is
/// expected to interact with it to perform any changes to the IR from here.
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(TransposeOp op,
mlir::PatternRewriter &rewriter) const override {
// Look through the input of the current transpose.

View File

@ -11,7 +11,6 @@
//===----------------------------------------------------------------------===//
#include "mlir/IR/Diagnostics.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
#include "toy/Lexer.h"

View File

@ -23,7 +23,6 @@
#include "mlir/Interfaces/CallInterfaces.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/InliningUtils.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
@ -204,7 +203,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
/// Verifier for the constant operation. This corresponds to the
/// `let hasVerifier = 1` in the op definition.
mlir::LogicalResult ConstantOp::verify() {
llvm::LogicalResult ConstantOp::verify() {
// If the return type of the constant is not an unranked tensor, the shape
// must match the shape of the attribute holding the data.
auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
@ -372,7 +371,7 @@ void MulOp::inferShapes() { getResult().setType(getLhs().getType()); }
// ReturnOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult ReturnOp::verify() {
llvm::LogicalResult ReturnOp::verify() {
// We know that the parent operation is a function, because of the 'HasParent'
// trait attached to the operation definition.
auto function = cast<FuncOp>((*this)->getParentOp());
@ -421,7 +420,7 @@ void TransposeOp::inferShapes() {
getResult().setType(RankedTensorType::get(dims, arrayTy.getElementType()));
}
mlir::LogicalResult TransposeOp::verify() {
llvm::LogicalResult TransposeOp::verify() {
auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
if (!inputType || !resultType)

View File

@ -21,7 +21,6 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/ValueRange.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Support/TypeID.h"
#include "toy/Dialect.h"
#include "toy/Passes.h"

View File

@ -15,7 +15,6 @@
#include "mlir/IR/Block.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
@ -105,7 +104,7 @@ private:
/// Declare a variable in the current scope, return success if the variable
/// wasn't declared yet.
mlir::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
llvm::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
if (symbolTable.count(var))
return mlir::failure();
symbolTable.insert(var, value);
@ -229,7 +228,7 @@ private:
}
/// Emit a return operation. This will return failure if any generation fails.
mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
auto location = loc(ret.loc());
// 'return' takes an optional expression, handle that case here.
@ -341,7 +340,7 @@ private:
/// Emit a print expression. It emits specific operations for two builtins:
/// transpose(x) and print(x).
mlir::LogicalResult mlirGen(PrintExprAST &call) {
llvm::LogicalResult mlirGen(PrintExprAST &call) {
auto arg = mlirGen(*call.getArg());
if (!arg)
return mlir::failure();
@ -407,7 +406,7 @@ private:
}
/// Codegen a list of expression, return failure if one of them hit an error.
mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
ScopedHashTableScope<StringRef, mlir::Value> varScope(symbolTable);
for (auto &expr : blockAST) {
// Specific handling for variable declarations, return statement, and

View File

@ -14,7 +14,6 @@
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/Dialect.h"
using namespace mlir;
using namespace toy;
@ -36,7 +35,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// This method attempts to match a pattern and rewrite it. The rewriter
/// argument is the orchestrator of the sequence of rewrites. The pattern is
/// expected to interact with it to perform any changes to the IR from here.
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(TransposeOp op,
mlir::PatternRewriter &rewriter) const override {
// Look through the input of the current transpose.

View File

@ -12,7 +12,6 @@
#include "mlir/Dialect/Func/Extensions/AllExtensions.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
#include "toy/Lexer.h"

View File

@ -23,7 +23,6 @@
#include "mlir/Interfaces/CallInterfaces.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/InliningUtils.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
@ -204,7 +203,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
/// Verifier for the constant operation. This corresponds to the
/// `let hasVerifier = 1` in the op definition.
mlir::LogicalResult ConstantOp::verify() {
llvm::LogicalResult ConstantOp::verify() {
// If the return type of the constant is not an unranked tensor, the shape
// must match the shape of the attribute holding the data.
auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
@ -372,7 +371,7 @@ void MulOp::inferShapes() { getResult().setType(getLhs().getType()); }
// ReturnOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult ReturnOp::verify() {
llvm::LogicalResult ReturnOp::verify() {
// We know that the parent operation is a function, because of the 'HasParent'
// trait attached to the operation definition.
auto function = cast<FuncOp>((*this)->getParentOp());
@ -421,7 +420,7 @@ void TransposeOp::inferShapes() {
getResult().setType(RankedTensorType::get(dims, arrayTy.getElementType()));
}
mlir::LogicalResult TransposeOp::verify() {
llvm::LogicalResult TransposeOp::verify() {
auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
if (!inputType || !resultType)

View File

@ -21,7 +21,6 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/ValueRange.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Support/TypeID.h"
#include "toy/Dialect.h"
#include "toy/Passes.h"

View File

@ -28,7 +28,6 @@
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Support/TypeID.h"
#include "toy/Dialect.h"
#include "toy/Passes.h"

View File

@ -15,7 +15,6 @@
#include "mlir/IR/Block.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
@ -105,7 +104,7 @@ private:
/// Declare a variable in the current scope, return success if the variable
/// wasn't declared yet.
mlir::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
llvm::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
if (symbolTable.count(var))
return mlir::failure();
symbolTable.insert(var, value);
@ -229,7 +228,7 @@ private:
}
/// Emit a return operation. This will return failure if any generation fails.
mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
auto location = loc(ret.loc());
// 'return' takes an optional expression, handle that case here.
@ -341,7 +340,7 @@ private:
/// Emit a print expression. It emits specific operations for two builtins:
/// transpose(x) and print(x).
mlir::LogicalResult mlirGen(PrintExprAST &call) {
llvm::LogicalResult mlirGen(PrintExprAST &call) {
auto arg = mlirGen(*call.getArg());
if (!arg)
return mlir::failure();
@ -407,7 +406,7 @@ private:
}
/// Codegen a list of expression, return failure if one of them hit an error.
mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
ScopedHashTableScope<StringRef, mlir::Value> varScope(symbolTable);
for (auto &expr : blockAST) {
// Specific handling for variable declarations, return statement, and

View File

@ -14,7 +14,6 @@
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/Dialect.h"
using namespace mlir;
using namespace toy;
@ -36,7 +35,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// This method attempts to match a pattern and rewrite it. The rewriter
/// argument is the orchestrator of the sequence of rewrites. The pattern is
/// expected to interact with it to perform any changes to the IR from here.
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(TransposeOp op,
mlir::PatternRewriter &rewriter) const override {
// Look through the input of the current transpose.

View File

@ -12,7 +12,6 @@
#include "mlir/Dialect/Func/Extensions/AllExtensions.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
#include "toy/Lexer.h"

View File

@ -27,7 +27,6 @@
#include "mlir/Interfaces/CallInterfaces.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/InliningUtils.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Hashing.h"
@ -195,7 +194,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
}
/// Verify that the given attribute value is valid for the given type.
static mlir::LogicalResult verifyConstantForType(mlir::Type type,
static llvm::LogicalResult verifyConstantForType(mlir::Type type,
mlir::Attribute opaqueValue,
mlir::Operation *op) {
if (llvm::isa<mlir::TensorType>(type)) {
@ -252,11 +251,11 @@ static mlir::LogicalResult verifyConstantForType(mlir::Type type,
/// Verifier for the constant operation. This corresponds to the `::verify(...)`
/// in the op definition.
mlir::LogicalResult ConstantOp::verify() {
llvm::LogicalResult ConstantOp::verify() {
return verifyConstantForType(getResult().getType(), getValue(), *this);
}
mlir::LogicalResult StructConstantOp::verify() {
llvm::LogicalResult StructConstantOp::verify() {
return verifyConstantForType(getResult().getType(), getValue(), *this);
}
@ -406,7 +405,7 @@ void MulOp::inferShapes() { getResult().setType(getLhs().getType()); }
// ReturnOp
//===----------------------------------------------------------------------===//
mlir::LogicalResult ReturnOp::verify() {
llvm::LogicalResult ReturnOp::verify() {
// We know that the parent operation is a function, because of the 'HasParent'
// trait attached to the operation definition.
auto function = cast<FuncOp>((*this)->getParentOp());
@ -454,7 +453,7 @@ void StructAccessOp::build(mlir::OpBuilder &b, mlir::OperationState &state,
build(b, state, resultType, input, b.getI64IntegerAttr(index));
}
mlir::LogicalResult StructAccessOp::verify() {
llvm::LogicalResult StructAccessOp::verify() {
StructType structTy = llvm::cast<StructType>(getInput().getType());
size_t indexValue = getIndex();
if (indexValue >= structTy.getNumElementTypes())
@ -483,7 +482,7 @@ void TransposeOp::inferShapes() {
getResult().setType(RankedTensorType::get(dims, arrayTy.getElementType()));
}
mlir::LogicalResult TransposeOp::verify() {
llvm::LogicalResult TransposeOp::verify() {
auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
if (!inputType || !resultType)

View File

@ -21,7 +21,6 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/ValueRange.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Support/TypeID.h"
#include "toy/Dialect.h"
#include "toy/Passes.h"

View File

@ -28,7 +28,6 @@
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Support/TypeID.h"
#include "toy/Dialect.h"
#include "toy/Passes.h"

View File

@ -15,7 +15,6 @@
#include "mlir/IR/Block.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
@ -133,7 +132,7 @@ private:
/// Declare a variable in the current scope, return success if the variable
/// wasn't declared yet.
mlir::LogicalResult declare(VarDeclExprAST &var, mlir::Value value) {
llvm::LogicalResult declare(VarDeclExprAST &var, mlir::Value value) {
if (symbolTable.count(var.getName()))
return mlir::failure();
symbolTable.insert(var.getName(), {value, &var});
@ -141,7 +140,7 @@ private:
}
/// Create an MLIR type for the given struct.
mlir::LogicalResult mlirGen(StructAST &str) {
llvm::LogicalResult mlirGen(StructAST &str) {
if (structMap.count(str.getName()))
return emitError(loc(str.loc())) << "error: struct type with name `"
<< str.getName() << "' already exists";
@ -368,7 +367,7 @@ private:
}
/// Emit a return operation. This will return failure if any generation fails.
mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
auto location = loc(ret.loc());
// 'return' takes an optional expression, handle that case here.
@ -542,7 +541,7 @@ private:
/// Emit a print expression. It emits specific operations for two builtins:
/// transpose(x) and print(x).
mlir::LogicalResult mlirGen(PrintExprAST &call) {
llvm::LogicalResult mlirGen(PrintExprAST &call) {
auto arg = mlirGen(*call.getArg());
if (!arg)
return mlir::failure();
@ -626,7 +625,7 @@ private:
}
/// Codegen a list of expression, return failure if one of them hit an error.
mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
SymbolTableScopeT varScope(symbolTable);
for (auto &expr : blockAST) {
// Specific handling for variable declarations, return statement, and

View File

@ -16,7 +16,6 @@
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/Dialect.h"
#include "llvm/Support/Casting.h"
#include <cstddef>
@ -57,7 +56,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// This method attempts to match a pattern and rewrite it. The rewriter
/// argument is the orchestrator of the sequence of rewrites. The pattern is
/// expected to interact with it to perform any changes to the IR from here.
mlir::LogicalResult
llvm::LogicalResult
matchAndRewrite(TransposeOp op,
mlir::PatternRewriter &rewriter) const override {
// Look through the input of the current transpose.

View File

@ -12,7 +12,6 @@
#include "mlir/Dialect/Func/Extensions/AllExtensions.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Support/LogicalResult.h"
#include "toy/AST.h"
#include "toy/Dialect.h"
#include "toy/Lexer.h"

View File

@ -118,7 +118,7 @@ public:
DiagnosticHandlerWrapper &operator=(DiagnosticHandlerWrapper &&) = default;
/// Verifies the captured "expected-*" diagnostics if required.
mlir::LogicalResult verify() const {
llvm::LogicalResult verify() const {
if (auto *ptr =
handler.dyn_cast<mlir::SourceMgrDiagnosticVerifierHandler *>()) {
return ptr->verify();
@ -192,7 +192,7 @@ public:
/// If diagnostic message verification has been requested upon construction of
/// this source manager, performs the verification, reports errors and returns
/// the result of the verification. Otherwise passes through the given value.
mlir::LogicalResult checkResult(mlir::LogicalResult result) {
llvm::LogicalResult checkResult(llvm::LogicalResult result) {
resultChecked = true;
if (!verifyDiagnostics)
return result;
@ -222,7 +222,7 @@ private:
/// Trivial wrapper around `applyTransforms` that doesn't support extra mapping
/// and doesn't enforce the entry point transform ops being top-level.
static mlir::LogicalResult
static llvm::LogicalResult
applyTransforms(mlir::Operation *payloadRoot,
mlir::transform::TransformOpInterface transformRoot,
const mlir::transform::TransformOptions &options) {
@ -237,7 +237,7 @@ applyTransforms(mlir::Operation *payloadRoot,
/// application is successful, prints the transformed input buffer into the
/// given output stream. Additional configuration options are derived from
/// command-line options.
static mlir::LogicalResult processPayloadBuffer(
static llvm::LogicalResult processPayloadBuffer(
raw_ostream &os, std::unique_ptr<MemoryBuffer> inputBuffer,
std::unique_ptr<llvm::MemoryBuffer> transformBuffer,
MutableArrayRef<std::unique_ptr<MemoryBuffer>> transformLibraries,
@ -309,7 +309,7 @@ static mlir::LogicalResult processPayloadBuffer(
}
/// Tool entry point.
static mlir::LogicalResult runMain(int argc, char **argv) {
static llvm::LogicalResult runMain(int argc, char **argv) {
// Register all upstream dialects and extensions. Specific uses are advised
// not to register all dialects indiscriminately but rather hand-pick what is
// necessary for their use case.

View File

@ -166,7 +166,7 @@ void mlir::transform::HasOperandSatisfyingOp::getEffects(
// Verify well-formedness of the operation and emit diagnostics if it is
// ill-formed.
mlir::LogicalResult mlir::transform::HasOperandSatisfyingOp::verify() {
llvm::LogicalResult mlir::transform::HasOperandSatisfyingOp::verify() {
mlir::Block &bodyBlock = getBody().front();
if (bodyBlock.getNumArguments() != 1 ||
!isa<TransformValueHandleTypeInterface>(

View File

@ -13,7 +13,6 @@
#include "mlir/Analysis/Presburger/Matrix.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/Support/LogicalResult.h"
#include <optional>
namespace mlir {

View File

@ -19,7 +19,6 @@
#include "mlir/IR/Dialect.h"
#include "mlir/IR/DialectInterface.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/Support/LogicalResult.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Twine.h"

View File

@ -18,7 +18,6 @@
#include "mlir/Bytecode/BytecodeReader.h"
#include "mlir/Bytecode/BytecodeWriter.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/Support/LogicalResult.h"
/// Include the generated interface declarations.
#include "mlir/Bytecode/BytecodeOpInterface.h.inc"

View File

@ -15,7 +15,6 @@
#include "mlir/IR/AsmState.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include <functional>
#include <memory>

View File

@ -14,7 +14,6 @@
#define MLIR_BYTECODE_BYTECODEREADERCONFIG_H
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"

View File

@ -17,9 +17,9 @@
#include "mlir-c/Support.h"
#include "mlir/CAPI/Wrap.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Support/TypeID.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/LogicalResult.h"
namespace llvm {
class ThreadPoolInterface;
@ -35,13 +35,13 @@ inline llvm::StringRef unwrap(MlirStringRef ref) {
return llvm::StringRef(ref.data, ref.length);
}
inline MlirLogicalResult wrap(mlir::LogicalResult res) {
inline MlirLogicalResult wrap(llvm::LogicalResult res) {
if (mlir::succeeded(res))
return mlirLogicalResultSuccess();
return mlirLogicalResultFailure();
}
inline mlir::LogicalResult unwrap(MlirLogicalResult res) {
inline llvm::LogicalResult unwrap(MlirLogicalResult res) {
return mlir::success(mlirLogicalResultIsSuccess(res));
}

View File

@ -13,7 +13,6 @@
namespace mlir {
class Location;
struct LogicalResult;
class OpBuilder;
class Pass;
class RewritePattern;

View File

@ -11,7 +11,6 @@
#include "mlir/IR/DialectInterface.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/Support/LogicalResult.h"
namespace mlir {
class ConversionTarget;

View File

@ -15,7 +15,6 @@
#define MLIR_CONVERSION_FUNCTOLLVM_CONVERTFUNCTOLLVM_H
#include "mlir/Interfaces/FunctionInterfaces.h"
#include "mlir/Support/LogicalResult.h"
namespace mlir {

View File

@ -26,7 +26,6 @@ namespace mlir {
class LLVMTypeConverter;
class Location;
struct LogicalResult;
class ModuleOp;
class Operation;
class RewritePatternSet;

View File

@ -12,7 +12,6 @@
namespace mlir {
class ConversionTarget;
struct LogicalResult;
class MLIRContext;
class Value;
class Operation;

View File

@ -12,7 +12,6 @@
#include "mlir/IR/PatternMatch.h"
namespace mlir {
struct LogicalResult;
class MLIRContext;
class Pass;
class RewritePatternSet;

View File

@ -10,7 +10,6 @@
#define MLIR_DEBUG_CLOPTIONSSETUP_H
#include "mlir/Debug/BreakpointManagers/FileLineColLocBreakpointManager.h"
#include "mlir/Support/LogicalResult.h"
#include "llvm/ADT/StringRef.h"
#include <memory>

View File

@ -8,7 +8,7 @@
#ifndef MLIR_DIALECT_AMDGPU_UTILS_CHIPSET_H_
#define MLIR_DIALECT_AMDGPU_UTILS_CHIPSET_H_
#include "mlir/Support/LogicalResult.h"
#include "mlir/Support/LLVM.h"
namespace mlir {
namespace amdgpu {

View File

@ -18,7 +18,6 @@
#include "mlir/Analysis/Presburger/Matrix.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/Support/LogicalResult.h"
#include <optional>
namespace mlir {

View File

@ -9,7 +9,7 @@
#ifndef MLIR_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H
#define MLIR_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H
#include "mlir/Support/LogicalResult.h"
#include "mlir/Support/LLVM.h"
namespace mlir {
class DialectRegistry;

View File

@ -17,7 +17,6 @@
#include "mlir/IR/Block.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/RegionUtils.h"
#include <optional>

View File

@ -16,7 +16,6 @@
#include "mlir/Interfaces/ValueBoundsOpInterface.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
namespace mlir {
class AffineMap;

View File

@ -33,8 +33,6 @@ namespace memref {
class AllocOp;
} // namespace memref
struct LogicalResult;
namespace affine {
class AffineForOp;
class AffineIfOp;

View File

@ -10,7 +10,6 @@
#define MLIR_DIALECT_ARITH_TRANSFORMS_TRANSFORMS_H
#include "mlir/Interfaces/ValueBoundsOpInterface.h"
#include "mlir/Support/LogicalResult.h"
namespace mlir {
class Location;

View File

@ -378,7 +378,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
This method can query analysis information from the given analysis
state.
}],
/*retType=*/"::mlir::LogicalResult",
/*retType=*/"::llvm::LogicalResult",
/*methodName=*/"resolveConflicts",
/*args=*/(ins "::mlir::RewriterBase &":$rewriter,
"const ::mlir::bufferization::AnalysisState &":$state),
@ -423,7 +423,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
suggestion to make sure IR is valid at every point in time and could
be done differently).
}],
/*retType=*/"::mlir::LogicalResult",
/*retType=*/"::llvm::LogicalResult",
/*methodName=*/"bufferize",
/*args=*/(ins "::mlir::RewriterBase &":$rewriter,
"const ::mlir::bufferization::BufferizationOptions &":$options),
@ -490,7 +490,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
This method can be used to check expected invariants and limitations
of the current bufferization implementation.
}],
/*retType=*/"::mlir::LogicalResult",
/*retType=*/"::llvm::LogicalResult",
/*methodName=*/"verifyAnalysis",
/*args=*/(ins "const ::mlir::bufferization::AnalysisState &":$state),
/*methodBody=*/"",
@ -613,7 +613,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
let extraClassDeclaration = [{
/// Resolve out-of-place tensor OpOperands with explicit allocations in the
/// form of `bufferization.alloc_tensor` ops.
::mlir::LogicalResult resolveTensorOpOperandConflicts(
::llvm::LogicalResult resolveTensorOpOperandConflicts(
::mlir::RewriterBase &rewriter,
const ::mlir::bufferization::AnalysisState &state);

View File

@ -9,9 +9,11 @@
#ifndef MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_ONESHOTMODULEBUFFERIZE_H
#define MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_ONESHOTMODULEBUFFERIZE_H
namespace mlir {
namespace llvm {
struct LogicalResult;
} // namespace llvm
namespace mlir {
class ModuleOp;
namespace bufferization {
@ -21,8 +23,9 @@ struct OneShotBufferizationOptions;
/// Analyze `moduleOp` and its nested ops. Bufferization decisions are stored in
/// `state`.
LogicalResult analyzeModuleOp(ModuleOp moduleOp, OneShotAnalysisState &state,
BufferizationStatistics *statistics = nullptr);
llvm::LogicalResult
analyzeModuleOp(ModuleOp moduleOp, OneShotAnalysisState &state,
BufferizationStatistics *statistics = nullptr);
/// Bufferize `op` and its nested ops that implement `BufferizableOpInterface`.
///
@ -33,9 +36,9 @@ LogicalResult analyzeModuleOp(ModuleOp moduleOp, OneShotAnalysisState &state,
/// - `options.copyBeforeWrite` is not set and `options.noAnalysisFuncFilter`
/// is not empty. The FuncOps it contains were not analyzed. Buffer copies
/// will be inserted only to these FuncOps.
LogicalResult bufferizeModuleOp(ModuleOp moduleOp,
const OneShotBufferizationOptions &options,
BufferizationStatistics *statistics = nullptr);
llvm::LogicalResult
bufferizeModuleOp(ModuleOp moduleOp, const OneShotBufferizationOptions &options,
BufferizationStatistics *statistics = nullptr);
/// Remove bufferization attributes on every FuncOp arguments in the ModuleOp.
void removeBufferizationAttributesInModule(ModuleOp moduleOp);
@ -44,7 +47,7 @@ void removeBufferizationAttributesInModule(ModuleOp moduleOp);
/// function call analysis to determine which function arguments are
/// inplaceable. Then analyzes and bufferizes FuncOps one-by-one with One-Shot
/// Bufferize.
LogicalResult runOneShotModuleBufferize(
llvm::LogicalResult runOneShotModuleBufferize(
ModuleOp moduleOp,
const bufferization::OneShotBufferizationOptions &options,
BufferizationStatistics *statistics = nullptr);

View File

@ -113,7 +113,7 @@ def OffloadingLLVMTranslationAttrInterface :
The first argument has to be a GPU binary operation.
If the function fails at any point, it must return `failure`.
}],
"::mlir::LogicalResult", "embedBinary",
"::llvm::LogicalResult", "embedBinary",
(ins "::mlir::Operation*":$binaryOp,
"::llvm::IRBuilderBase&":$hostBuilder,
"::mlir::LLVM::ModuleTranslation&":$hostModuleTranslation)
@ -130,7 +130,7 @@ def OffloadingLLVMTranslationAttrInterface :
respectively. If the function fails at any point, it must return
`failure`.
}],
"::mlir::LogicalResult", "launchKernel",
"::llvm::LogicalResult", "launchKernel",
(ins "::mlir::Operation*":$launchFunc, "::mlir::Operation*":$binaryOp,
"::llvm::IRBuilderBase&":$hostBuilder,
"::mlir::LLVM::ModuleTranslation&":$hostModuleTranslation)

View File

@ -21,7 +21,6 @@
namespace mlir {
class AffineMap;
struct LogicalResult;
class Operation;
class Region;

View File

@ -20,7 +20,6 @@
#include <string>
namespace mlir {
struct LogicalResult;
class Operation;
class Value;

View File

@ -19,7 +19,6 @@
#include "mlir/IR/ExtensibleDialect.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/Types.h"
#include "mlir/Support/LogicalResult.h"
#include <optional>
namespace mlir {

Some files were not shown because too many files have changed in this diff Show More