-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[flang] Remove dead functions for getting LLVM intrinsics #137743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flang] Remove dead functions for getting LLVM intrinsics #137743
Conversation
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.
@llvm/pr-subscribers-flang-fir-hlfir Author: Asher Mancinelli (ashermancinelli) ChangesIn 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. Full diff: https://github.com/llvm/llvm-project/pull/137743.diff 2 Files Affected:
diff --git a/flang/include/flang/Optimizer/Builder/LowLevelIntrinsics.h b/flang/include/flang/Optimizer/Builder/LowLevelIntrinsics.h
index 45499906e39f8..9303f09d42fb9 100644
--- a/flang/include/flang/Optimizer/Builder/LowLevelIntrinsics.h
+++ b/flang/include/flang/Optimizer/Builder/LowLevelIntrinsics.h
@@ -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);
diff --git a/flang/lib/Optimizer/Builder/LowLevelIntrinsics.cpp b/flang/lib/Optimizer/Builder/LowLevelIntrinsics.cpp
index 73fd8fa0c2b61..64d70d70829fb 100644
--- a/flang/lib/Optimizer/Builder/LowLevelIntrinsics.cpp
+++ b/flang/lib/Optimizer/Builder/LowLevelIntrinsics.cpp
@@ -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()};
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Asher!
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.
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.
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.
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.
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.
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.