[flang] Remove dead functions for getting LLVM intrinsics (#137743)

In cleaning up LowLevelIntrinsics I found some uncalled functions. We
would like to remove direct calls to llvm instructions wherever possible
to make it easier on consumers of our IR to match LLVM intrinsics, so if
this code is needed again we should use the op from the llvm dialect
instead anyways.
This commit is contained in:
Asher Mancinelli
2025-04-29 06:47:13 -07:00
committed by GitHub
parent db2315afa8
commit 1433c3e997
2 changed files with 0 additions and 13 deletions

View File

@@ -24,9 +24,6 @@ class FirOpBuilder;
namespace fir::factory {
/// Get the LLVM intrinsic for `memset`. Use the 64 bit version.
mlir::func::FuncOp getLlvmMemset(FirOpBuilder &builder);
/// Get the C standard library `realloc` function.
mlir::func::FuncOp getRealloc(FirOpBuilder &builder);

View File

@@ -21,16 +21,6 @@
#include "flang/Optimizer/Builder/LowLevelIntrinsics.h"
#include "flang/Optimizer/Builder/FIRBuilder.h"
mlir::func::FuncOp fir::factory::getLlvmMemset(fir::FirOpBuilder &builder) {
auto ptrTy = builder.getRefType(builder.getIntegerType(8));
llvm::SmallVector<mlir::Type> args = {ptrTy, ptrTy, builder.getI64Type(),
builder.getI1Type()};
auto memsetTy =
mlir::FunctionType::get(builder.getContext(), args, std::nullopt);
return builder.createFunction(builder.getUnknownLoc(),
"llvm.memset.p0.p0.i64", memsetTy);
}
mlir::func::FuncOp fir::factory::getRealloc(fir::FirOpBuilder &builder) {
auto ptrTy = builder.getRefType(builder.getIntegerType(8));
llvm::SmallVector<mlir::Type> args = {ptrTy, builder.getI64Type()};