Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions mlir/include/mlir/Conversion/ArithToAPFloat/ArithToAPFloat.h

This file was deleted.

1 change: 0 additions & 1 deletion mlir/include/mlir/Conversion/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h"
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
#include "mlir/Conversion/ArithToAMDGPU/ArithToAMDGPU.h"
#include "mlir/Conversion/ArithToAPFloat/ArithToAPFloat.h"
#include "mlir/Conversion/ArithToArmSME/ArithToArmSME.h"
#include "mlir/Conversion/ArithToEmitC/ArithToEmitCPass.h"
#include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h"
Expand Down
15 changes: 0 additions & 15 deletions mlir/include/mlir/Conversion/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,6 @@ def ArithToLLVMConversionPass : Pass<"convert-arith-to-llvm"> {
];
}

//===----------------------------------------------------------------------===//
// ArithToAPFloat
//===----------------------------------------------------------------------===//

def ArithToAPFloatConversionPass
: Pass<"convert-arith-to-apfloat", "ModuleOp"> {
let summary = "Convert Arith ops to APFloat runtime library calls";
let description = [{
This pass converts supported Arith ops to APFloat-based runtime library
calls (APFloatWrappers.cpp). APFloat is a software implementation of
floating-point arithmetic operations.
}];
let dependentDialects = ["func::FuncDialect"];
}

//===----------------------------------------------------------------------===//
// ArithToSPIRV
//===----------------------------------------------------------------------===//
Expand Down
7 changes: 0 additions & 7 deletions mlir/include/mlir/Dialect/Func/Utils/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ mlir::FailureOr<std::pair<mlir::func::FuncOp, mlir::func::CallOp>>
deduplicateArgsOfFuncOp(mlir::RewriterBase &rewriter, mlir::func::FuncOp funcOp,
mlir::ModuleOp moduleOp);

/// Look up a FuncOp with signature `resultTypes`(`paramTypes`)` and name
/// `name`. Return a failure if the FuncOp is found but with a different
/// signature.
FailureOr<FuncOp> lookupFnDecl(SymbolOpInterface symTable, StringRef name,
FunctionType funcT,
SymbolTableCollection *symbolTables = nullptr);

} // namespace func
} // namespace mlir

Expand Down
4 changes: 0 additions & 4 deletions mlir/include/mlir/Dialect/LLVMIR/FunctionCallUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ lookupOrCreatePrintF32Fn(OpBuilder &b, Operation *moduleOp,
FailureOr<LLVM::LLVMFuncOp>
lookupOrCreatePrintF64Fn(OpBuilder &b, Operation *moduleOp,
SymbolTableCollection *symbolTables = nullptr);
FailureOr<LLVM::LLVMFuncOp>
lookupOrCreateApFloatPrintFn(OpBuilder &b, Operation *moduleOp,
SymbolTableCollection *symbolTables = nullptr);

/// Declares a function to print a C-string.
/// If a custom runtime function is defined via `runtimeFunctionName`, it must
/// have the signature void(char const*). The default function is `printString`.
Expand Down
158 changes: 0 additions & 158 deletions mlir/lib/Conversion/ArithToAPFloat/ArithToAPFloat.cpp

This file was deleted.

18 changes: 0 additions & 18 deletions mlir/lib/Conversion/ArithToAPFloat/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "mlir/Conversion/LLVMCommon/VectorPattern.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Arith/Transforms/Passes.h"
#include "mlir/Dialect/LLVMIR/FunctionCallUtils.h"
#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/IR/TypeUtilities.h"
Expand Down
1 change: 0 additions & 1 deletion mlir/lib/Conversion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ add_subdirectory(AffineToStandard)
add_subdirectory(AMDGPUToROCDL)
add_subdirectory(ArithCommon)
add_subdirectory(ArithToAMDGPU)
add_subdirectory(ArithToAPFloat)
add_subdirectory(ArithToArmSME)
add_subdirectory(ArithToEmitC)
add_subdirectory(ArithToLLVM)
Expand Down
14 changes: 0 additions & 14 deletions mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1654,20 +1654,6 @@ class VectorPrintOpConversion : public ConvertOpToLLVMPattern<vector::PrintOp> {
return failure();
}
}
} else if (auto floatTy = dyn_cast<FloatType>(printType)) {
// Print other floating-point types using the APFloat runtime library.
int32_t sem =
llvm::APFloatBase::SemanticsToEnum(floatTy.getFloatSemantics());
Value semValue = LLVM::ConstantOp::create(
rewriter, loc, rewriter.getI32Type(),
rewriter.getIntegerAttr(rewriter.getI32Type(), sem));
Value floatBits =
LLVM::ZExtOp::create(rewriter, loc, rewriter.getI64Type(), value);
printer =
LLVM::lookupOrCreateApFloatPrintFn(rewriter, parent, symbolTables);
emitCall(rewriter, loc, printer.value(),
ValueRange({semValue, floatBits}));
return success();
} else {
return failure();
}
Expand Down
25 changes: 0 additions & 25 deletions mlir/lib/Dialect/Func/Utils/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,28 +254,3 @@ func::deduplicateArgsOfFuncOp(RewriterBase &rewriter, func::FuncOp funcOp,

return std::make_pair(*newFuncOpOrFailure, newCallOp);
}

FailureOr<func::FuncOp>
func::lookupFnDecl(SymbolOpInterface symTable, StringRef name,
FunctionType funcT, SymbolTableCollection *symbolTables) {
FuncOp func;
if (symbolTables) {
func = symbolTables->lookupSymbolIn<FuncOp>(
symTable, StringAttr::get(symTable->getContext(), name));
} else {
func = llvm::dyn_cast_or_null<FuncOp>(
SymbolTable::lookupSymbolIn(symTable, name));
}

if (!func)
return func;

mlir::FunctionType foundFuncT = func.getFunctionType();
// Assert the signature of the found function is same as expected
if (funcT != foundFuncT) {
return func.emitError("matched function '")
<< name << "' but with different type: " << foundFuncT
<< " (expected " << funcT << ")";
}
return func;
}
11 changes: 0 additions & 11 deletions mlir/lib/Dialect/LLVMIR/IR/FunctionCallUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ static constexpr llvm::StringRef kPrintF16 = "printF16";
static constexpr llvm::StringRef kPrintBF16 = "printBF16";
static constexpr llvm::StringRef kPrintF32 = "printF32";
static constexpr llvm::StringRef kPrintF64 = "printF64";
static constexpr llvm::StringRef kPrintApFloat = "printApFloat";
static constexpr llvm::StringRef kPrintString = "printString";
static constexpr llvm::StringRef kPrintOpen = "printOpen";
static constexpr llvm::StringRef kPrintClose = "printClose";
Expand Down Expand Up @@ -161,16 +160,6 @@ mlir::LLVM::lookupOrCreatePrintF64Fn(OpBuilder &b, Operation *moduleOp,
LLVM::LLVMVoidType::get(moduleOp->getContext()), symbolTables);
}

FailureOr<LLVM::LLVMFuncOp>
mlir::LLVM::lookupOrCreateApFloatPrintFn(OpBuilder &b, Operation *moduleOp,
SymbolTableCollection *symbolTables) {
return lookupOrCreateReservedFn(
b, moduleOp, kPrintApFloat,
{IntegerType::get(moduleOp->getContext(), 32),
IntegerType::get(moduleOp->getContext(), 64)},
LLVM::LLVMVoidType::get(moduleOp->getContext()), symbolTables);
}

static LLVM::LLVMPointerType getCharPtr(MLIRContext *context) {
return LLVM::LLVMPointerType::get(context);
}
Expand Down
Loading
Loading