Skip to content

Commit f1e59dc

Browse files
authored
Renaming Cuf passes to CUF (#113351)
For consistency with other dialects and other CUF passes and files, this patch renames passes CufOpConversion to CUFOpConversion, CufImplicitDeviceGlobal to CUFDeviceGlobal. It also renames the file.
1 parent 395093e commit f1e59dc

File tree

7 files changed

+15
-16
lines changed

7 files changed

+15
-16
lines changed

flang/include/flang/Optimizer/Transforms/CufOpConversion.h renamed to flang/include/flang/Optimizer/Transforms/CUFOpConversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===------- Optimizer/Transforms/CufOpConversion.h -------------*- C++ -*-===//
1+
//===------- Optimizer/Transforms/CUFOpConversion.h -------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -19,7 +19,7 @@ class LLVMTypeConverter;
1919
namespace mlir {
2020
class DataLayout;
2121
class SymbolTable;
22-
}
22+
} // namespace mlir
2323

2424
namespace cuf {
2525

flang/include/flang/Optimizer/Transforms/Passes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace fir {
4040
#define GEN_PASS_DECL_CHARACTERCONVERSION
4141
#define GEN_PASS_DECL_CFGCONVERSION
4242
#define GEN_PASS_DECL_CUFADDCONSTRUCTOR
43-
#define GEN_PASS_DECL_CUFIMPLICITDEVICEGLOBAL
43+
#define GEN_PASS_DECL_CUFDEVICEGLOBAL
4444
#define GEN_PASS_DECL_CUFOPCONVERSION
4545
#define GEN_PASS_DECL_EXTERNALNAMECONVERSION
4646
#define GEN_PASS_DECL_MEMREFDATAFLOWOPT

flang/include/flang/Optimizer/Transforms/Passes.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,15 +421,15 @@ def AssumedRankOpConversion : Pass<"fir-assumed-rank-op", "mlir::ModuleOp"> {
421421
];
422422
}
423423

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

431-
def CufImplicitDeviceGlobal :
432-
Pass<"cuf-implicit-device-global", "mlir::ModuleOp"> {
431+
def CUFDeviceGlobal :
432+
Pass<"cuf-device-global", "mlir::ModuleOp"> {
433433
let summary = "Flag globals used in device function with data attribute";
434434
let dependentDialects = [
435435
"cuf::CUFDialect"

flang/lib/Optimizer/Transforms/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ add_flang_library(FIRTransforms
1010
ConstantArgumentGlobalisation.cpp
1111
ControlFlowConverter.cpp
1212
CUFAddConstructor.cpp
13-
CufImplicitDeviceGlobal.cpp
14-
CufOpConversion.cpp
13+
CUFDeviceGlobal.cpp
14+
CUFOpConversion.cpp
1515
ArrayValueCopy.cpp
1616
ExternalNameConversion.cpp
1717
MemoryUtils.cpp

flang/lib/Optimizer/Transforms/CufImplicitDeviceGlobal.cpp renamed to flang/lib/Optimizer/Transforms/CUFDeviceGlobal.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- CufOpConversion.cpp -----------------------------------------------===//
1+
//===-- CUFOpConversion.cpp -----------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -18,7 +18,7 @@
1818
#include "mlir/Transforms/DialectConversion.h"
1919

2020
namespace fir {
21-
#define GEN_PASS_DEF_CUFIMPLICITDEVICEGLOBAL
21+
#define GEN_PASS_DEF_CUFDEVICEGLOBAL
2222
#include "flang/Optimizer/Transforms/Passes.h.inc"
2323
} // namespace fir
2424

@@ -45,8 +45,7 @@ static void prepareImplicitDeviceGlobals(mlir::func::FuncOp funcOp,
4545
}
4646
}
4747

48-
class CufImplicitDeviceGlobal
49-
: public fir::impl::CufImplicitDeviceGlobalBase<CufImplicitDeviceGlobal> {
48+
class CUFDeviceGlobal : public fir::impl::CUFDeviceGlobalBase<CUFDeviceGlobal> {
5049
public:
5150
void runOnOperation() override {
5251
mlir::Operation *op = getOperation();

flang/lib/Optimizer/Transforms/CufOpConversion.cpp renamed to flang/lib/Optimizer/Transforms/CUFOpConversion.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//===-- CufOpConversion.cpp -----------------------------------------------===//
1+
//===-- CUFDeviceGlobal.cpp -----------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "flang/Optimizer/Transforms/CufOpConversion.h"
9+
#include "flang/Optimizer/Transforms/CUFOpConversion.h"
1010
#include "flang/Common/Fortran.h"
1111
#include "flang/Optimizer/Builder/Runtime/RTBuilder.h"
1212
#include "flang/Optimizer/CodeGen/TypeConverter.h"
@@ -619,7 +619,7 @@ struct CufDataTransferOpConversion
619619
const mlir::SymbolTable &symtab;
620620
};
621621

622-
class CufOpConversion : public fir::impl::CufOpConversionBase<CufOpConversion> {
622+
class CUFOpConversion : public fir::impl::CUFOpConversionBase<CUFOpConversion> {
623623
public:
624624
void runOnOperation() override {
625625
auto *ctx = &getContext();

flang/test/Fir/CUDA/cuda-implicit-device-global.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: fir-opt --split-input-file --cuf-implicit-device-global %s | FileCheck %s
1+
// RUN: fir-opt --split-input-file --cuf-device-global %s | FileCheck %s
22

33
// Test that global used in device function are flagged with the correct
44
// attribute.

0 commit comments

Comments
 (0)