[flang-commits] [flang] WIP: Trying to get a call treated as an intrinsic (PR #120020)
via flang-commits
flang-commits at lists.llvm.org
Sun Dec 15 13:19:13 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 2546ae4ed09ff69274c184ae7e98f2aa72e7e7f7 1b0239b5b7042950cff6afab7ea8766f110e6101 --extensions h,cpp -- flang/include/flang/Optimizer/Builder/IntrinsicCall.h flang/lib/Optimizer/Builder/IntrinsicCall.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index c358c492f6..01f615e000 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -1642,7 +1642,8 @@ mlir::Value toValue(const fir::ExtendedValue &val, fir::FirOpBuilder &builder,
static bool isIntrinsicModuleProcedure(llvm::StringRef name) {
llvm::errs() << "isIntrinsicModuleProcedure: " << name << "\n";
return name.starts_with("c_") || name.starts_with("compiler_") ||
- name.starts_with("ieee_") || name.starts_with("__ppc_") || name == "syncthreads1";
+ name.starts_with("ieee_") || name.starts_with("__ppc_") ||
+ name == "syncthreads1";
}
static bool isCoarrayIntrinsic(llvm::StringRef name) {
@@ -1686,7 +1687,8 @@ lookupIntrinsicHandler(fir::FirOpBuilder &builder,
llvm::StringRef intrinsicName,
std::optional<mlir::Type> resultType) {
llvm::StringRef name = genericName(intrinsicName);
- llvm::errs() << "Looking up " << intrinsicName << " with name " << name << "\n";
+ llvm::errs() << "Looking up " << intrinsicName << " with name " << name
+ << "\n";
if (const IntrinsicHandler *handler = findIntrinsicHandler(name))
return std::make_optional<IntrinsicHandlerEntry>(handler);
bool isPPCTarget = fir::getTargetTriple(builder.getModule()).isPPC();
@@ -7298,15 +7300,13 @@ void IntrinsicLibrary::genSyncThreads(llvm::ArrayRef<fir::ExtendedValue> args) {
constexpr llvm::StringLiteral funcName = "llvm.nvvm.barrier0";
mlir::func::FuncOp funcOp = builder.getNamedFunction(funcName);
mlir::MLIRContext *context = builder.getContext();
- mlir::FunctionType funcType =
- mlir::FunctionType::get(context, {}, {});
+ mlir::FunctionType funcType = mlir::FunctionType::get(context, {}, {});
- if (!funcOp)
+ if (!funcOp)
funcOp = builder.createFunction(loc, funcName, funcType);
-
+
llvm::SmallVector<mlir::Value> noArgs;
builder.create<fir::CallOp>(loc, funcOp, noArgs);
-
}
// SYSTEM
``````````
</details>
https://github.com/llvm/llvm-project/pull/120020
More information about the flang-commits
mailing list