Skip to content

Renaming Cuf passes to CUF #113351

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

Merged
merged 2 commits into from
Oct 22, 2024
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===------- Optimizer/Transforms/CufOpConversion.h -------------*- C++ -*-===//
//===------- Optimizer/Transforms/CUFOpConversion.h -------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -19,7 +19,7 @@ class LLVMTypeConverter;
namespace mlir {
class DataLayout;
class SymbolTable;
}
} // namespace mlir

namespace cuf {

Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Optimizer/Transforms/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace fir {
#define GEN_PASS_DECL_CHARACTERCONVERSION
#define GEN_PASS_DECL_CFGCONVERSION
#define GEN_PASS_DECL_CUFADDCONSTRUCTOR
#define GEN_PASS_DECL_CUFIMPLICITDEVICEGLOBAL
#define GEN_PASS_DECL_CUFDEVICEGLOBAL
#define GEN_PASS_DECL_CUFOPCONVERSION
#define GEN_PASS_DECL_EXTERNALNAMECONVERSION
#define GEN_PASS_DECL_MEMREFDATAFLOWOPT
Expand Down
6 changes: 3 additions & 3 deletions flang/include/flang/Optimizer/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,15 @@ def AssumedRankOpConversion : Pass<"fir-assumed-rank-op", "mlir::ModuleOp"> {
];
}

def CufOpConversion : Pass<"cuf-convert", "mlir::ModuleOp"> {
def CUFOpConversion : Pass<"cuf-convert", "mlir::ModuleOp"> {
let summary = "Convert some CUF operations to runtime calls";
let dependentDialects = [
"fir::FIROpsDialect"
];
}

def CufImplicitDeviceGlobal :
Pass<"cuf-implicit-device-global", "mlir::ModuleOp"> {
def CUFDeviceGlobal :
Pass<"cuf-device-global", "mlir::ModuleOp"> {
let summary = "Flag globals used in device function with data attribute";
let dependentDialects = [
"cuf::CUFDialect"
Expand Down
4 changes: 2 additions & 2 deletions flang/lib/Optimizer/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ add_flang_library(FIRTransforms
ConstantArgumentGlobalisation.cpp
ControlFlowConverter.cpp
CUFAddConstructor.cpp
CufImplicitDeviceGlobal.cpp
CufOpConversion.cpp
CUFDeviceGlobal.cpp
CUFOpConversion.cpp
ArrayValueCopy.cpp
ExternalNameConversion.cpp
MemoryUtils.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- CufOpConversion.cpp -----------------------------------------------===//
//===-- CUFOpConversion.cpp -----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -18,7 +18,7 @@
#include "mlir/Transforms/DialectConversion.h"

namespace fir {
#define GEN_PASS_DEF_CUFIMPLICITDEVICEGLOBAL
#define GEN_PASS_DEF_CUFDEVICEGLOBAL
#include "flang/Optimizer/Transforms/Passes.h.inc"
} // namespace fir

Expand All @@ -45,8 +45,7 @@ static void prepareImplicitDeviceGlobals(mlir::func::FuncOp funcOp,
}
}

class CufImplicitDeviceGlobal
: public fir::impl::CufImplicitDeviceGlobalBase<CufImplicitDeviceGlobal> {
class CUFDeviceGlobal : public fir::impl::CUFDeviceGlobalBase<CUFDeviceGlobal> {
public:
void runOnOperation() override {
mlir::Operation *op = getOperation();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//===-- CufOpConversion.cpp -----------------------------------------------===//
//===-- CUFDeviceGlobal.cpp -----------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "flang/Optimizer/Transforms/CufOpConversion.h"
#include "flang/Optimizer/Transforms/CUFOpConversion.h"
#include "flang/Common/Fortran.h"
#include "flang/Optimizer/Builder/Runtime/RTBuilder.h"
#include "flang/Optimizer/CodeGen/TypeConverter.h"
Expand Down Expand Up @@ -619,7 +619,7 @@ struct CufDataTransferOpConversion
const mlir::SymbolTable &symtab;
};

class CufOpConversion : public fir::impl::CufOpConversionBase<CufOpConversion> {
class CUFOpConversion : public fir::impl::CUFOpConversionBase<CUFOpConversion> {
public:
void runOnOperation() override {
auto *ctx = &getContext();
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Fir/CUDA/cuda-implicit-device-global.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: fir-opt --split-input-file --cuf-implicit-device-global %s | FileCheck %s
// RUN: fir-opt --split-input-file --cuf-device-global %s | FileCheck %s

// Test that global used in device function are flagged with the correct
// attribute.
Expand Down
Loading