Skip to content

Commit

Permalink
Revert "clean up lint (#699)" (#701)
Browse files Browse the repository at this point in the history
This reverts commit 76918df.
  • Loading branch information
makslevental authored Oct 27, 2023
1 parent 76918df commit fbc82f8
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 86 deletions.
69 changes: 69 additions & 0 deletions include/aie/AIETokenAnalysis.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//===- AIETokenAnalysis.h ---------------------------------------*- C++ -*-===//
//
// This file is licensed 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
//
// (c) Copyright 2019 Xilinx Inc.
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_AIE_LOCKANALYSIS_H
#define MLIR_AIE_LOCKANALYSIS_H

#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/TypeSupport.h"
#include "mlir/IR/Types.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "llvm/ADT/StringSwitch.h"

#include <map>

using namespace mlir;

namespace xilinx {
namespace AIE {

class TokenAnalysis {
ModuleOp &module;
DenseMap<StringRef, int> tokenSymbols;
DenseMap<StringRef, SmallVector<Operation *, 4>> tokenAcqMap;
DenseMap<StringRef, SmallVector<Operation *, 4>> tokenRelMap;
SmallVector<std::pair<Operation *, Operation *>, 4> tokenChains;
SmallVector<std::pair<Operation *, Operation *>, 4> tokenPairs;
DenseMap<std::pair<int, int>, Operation *> tiles;

public:
TokenAnalysis(ModuleOp &m) : module(m) {}

void runAnalysis();

auto getTokenSymbols() const { return tokenSymbols; }

auto getTokenAcqMap() const { return tokenAcqMap; }

auto getTokenRelMap() const { return tokenRelMap; }

auto getTokenChains() const { return tokenChains; }

auto getTokenPairs() const { return tokenPairs; }

auto getTiles() const { return tiles; }

// CoreOp or MemOp
Operation *getTokenUserOp(Operation *Op);
Operation *getShareableTileOp(Operation *Op1, Operation *Op2);
std::pair<int, int> getCoord(Operation *Op);

void print(raw_ostream &os);
};

} // namespace AIE
} // namespace xilinx

#endif
21 changes: 10 additions & 11 deletions include/aie/Dialect/AIE/IR/AIEDialect.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,19 @@ struct AIEDevDesc {

const xilinx::AIE::AIETargetModel &getTargetModel(Operation *op);

mlir::ParseResult
parseObjectFifoProducerTile(mlir::OpAsmParser &parser,
mlir::OpAsmParser::UnresolvedOperand &operand,
::mlir::ParseResult
parseObjectFifoProducerTile(::mlir::OpAsmParser &parser,
::mlir::OpAsmParser::UnresolvedOperand &operand,
DimTupleArrayAttr &dimensions);
void printObjectFifoProducerTile(::mlir::OpAsmPrinter &_odsPrinter,
Operation *op, Value tile,
Attribute dimensions);

void printObjectFifoProducerTile(mlir::OpAsmPrinter &_odsPrinter, Operation *op,
Value tile, Attribute dimensions);

mlir::ParseResult parseObjectFifoConsumerTiles(
mlir::OpAsmParser &parser,
SmallVectorImpl<mlir::OpAsmParser::UnresolvedOperand> &tiles,
::mlir::ParseResult parseObjectFifoConsumerTiles(
::mlir::OpAsmParser &parser,
SmallVectorImpl<::mlir::OpAsmParser::UnresolvedOperand> &tiles,
DimTupleArrayArrayAttr &dimensions);

void printObjectFifoConsumerTiles(mlir::OpAsmPrinter &_odsPrinter,
void printObjectFifoConsumerTiles(::mlir::OpAsmPrinter &_odsPrinter,
Operation *op, OperandRange tiles,
Attribute dimensions);

Expand Down
2 changes: 0 additions & 2 deletions include/aie/Dialect/AIE/Transforms/AIEPasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#ifndef AIE_PASSES_H
#define AIE_PASSES_H

#include "aie/Dialect/AIE/IR/AIEDialect.h"

#include "mlir/Pass/Pass.h"

namespace aie {
Expand Down
13 changes: 5 additions & 8 deletions include/aie/Dialect/AIE/Transforms/AIEPathfinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,23 @@
#ifndef AIE_PATHFINDER_H
#define AIE_PATHFINDER_H

#include "aie/Dialect/AIE/IR/AIEDialect.h" // for WireBundle and Port
#include <algorithm>
#include <limits>
#include <utility> //for std::pair
#include <vector>

// builds against at least boost graph 1.7.1
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#pragma GCC diagnostic ignored "-Wsuggest-override"

#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/graph_traits.hpp>

#pragma GCC diagnostic pop

#include <algorithm>
#include <limits>
#include <utility> //for std::pair
#include <vector>
#include "aie/Dialect/AIE/IR/AIEDialect.h" // for WireBundle and Port

namespace xilinx {
namespace AIE {
Expand Down Expand Up @@ -105,5 +103,4 @@ class Pathfinder {

} // namespace AIE
} // namespace xilinx

#endif
3 changes: 0 additions & 3 deletions include/aie/Dialect/AIEVec/Transforms/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
#ifndef AIE_DIALECT_AIEVEC_TRANSFORMS_PASSES_H
#define AIE_DIALECT_AIEVEC_TRANSFORMS_PASSES_H

#include "aie/Dialect/AIEVec/IR/AIEVecDialect.h"

#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassOptions.h"

#include <limits>

namespace mlir {
Expand Down
2 changes: 0 additions & 2 deletions include/aie/Dialect/AIEX/Transforms/AIEXPasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#ifndef AIEX_PASSES_H
#define AIEX_PASSES_H

#include "aie/Dialect/AIEX/IR/AIEXDialect.h"

#include "mlir/Pass/Pass.h"

namespace aie {
Expand Down
Loading

0 comments on commit fbc82f8

Please sign in to comment.