Skip to content

Commit

Permalink
Address the last comments
Browse files Browse the repository at this point in the history
  • Loading branch information
erman-gurses committed Feb 13, 2024
1 parent 82045ca commit 1e6a448
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//===- AMDGPUTransformOps.h - AMDGPU transform ops ----------------*- C++
//-*-===//
//===- AMDGPUTransformOps.h - AMDGPU transform ops ---------------*- 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 Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- AMDGPUTransformOps.td - AMDGPU transform ops ----------*- tablegen -*-===//
//===- AMDGPUTransformOps.td - AMDGPU transform ops --------*- tablegen -*-===//
//
// 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 @@ -24,9 +24,8 @@ def ApplyOptimizeSharedMemoryReadsAndWritesOp :
[DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
TransformOpInterface, TransformEachOpTrait]> {
let summary = "Reduce shared memory bank conflicts";
let description = [{ This opp adds a transformation and pass to the AMDGPU
dialect that attempts to optimize reads/writes from a memref representing
GPU shared memory in order to avoid bank conflicts.
let description = [{ This op attempts to optimize GPU Shared memory
reads/writes with the goal of avoiding bank conflicts.
}];

let arguments = (ins TransformHandleTypeInterface:$target);
Expand Down
22 changes: 2 additions & 20 deletions mlir/lib/Dialect/AMDGPU/TransformOps/AMDGPUTransformOps.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//===- AMDGPUTransformOps.cpp - Implementation of AMDGPU transform ops
//------===//
//===- AMDGPUTransformOps.cpp - Implementation of AMDGPU transform ops-----===//
//
// 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 @@ -9,26 +8,10 @@

#include "mlir/Dialect/AMDGPU/TransformOps/AMDGPUTransformOps.h"

#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Conversion/GPUCommon/GPUCommonPass.h"
#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h"
#include "mlir/Dialect/AMDGPU/Transforms/Transforms.h"
#include "mlir/Dialect/AMDGPU/Transforms/Utils.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/SCF/Transforms/Transforms.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Value.h"
#include "llvm/ADT/ArrayRef.h"

using namespace mlir;
using namespace mlir::amdgpu;
Expand Down Expand Up @@ -78,7 +61,6 @@ class AMDGPUTransformDialectExtension
#define GET_OP_CLASSES
#include "mlir/Dialect/AMDGPU/TransformOps/AMDGPUTransformOps.cpp.inc"

void mlir::amdgpu::registerTransformDialectExtension(
DialectRegistry &registry) {
void amdgpu::registerTransformDialectExtension(DialectRegistry &registry) {
registry.addExtensions<AMDGPUTransformDialectExtension>();
}
6 changes: 2 additions & 4 deletions mlir/lib/Dialect/AMDGPU/Transforms/OptimizeSharedMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Support/LogicalResult.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/MathExtras.h"

namespace mlir {
namespace amdgpu {
Expand Down Expand Up @@ -220,8 +218,8 @@ mlir::amdgpu::optimizeSharedMemoryReadsAndWrites(Operation *parentOp,
return success();
}

void mlir::amdgpu::optimizeSharedMemoryReadsAndWritesOp(
::mlir::func::FuncOp funcOp) {
void amdgpu::optimizeSharedMemoryReadsAndWritesOp(
func::FuncOp funcOp) {
SmallVector<memref::AllocOp> shmAllocOps;
funcOp.walk([&](memref::AllocOp allocOp) {
if (!amdgpu::AMDGPUDialect::hasSharedMemoryAddressSpace(allocOp.getType()))
Expand Down

0 comments on commit 1e6a448

Please sign in to comment.