Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
fifield committed May 9, 2024
1 parent 1af73f3 commit f8460ab
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions mlir/lib/Transform/AIRDependencyScheduleOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2117,14 +2117,12 @@ struct BroadcastDetection {
void getDmaOpLoopDependency(func::FuncOp f) {
f.walk([&](Operation *op) {
if (auto dma_op = mlir::dyn_cast<xilinx::air::DmaMemcpyNdOp>(op)) {
int src_memspace = llvm::cast<MemRefType>(dma_op.getSrcMemref()
.getType()
)
.getMemorySpaceAsInt();
int dst_memspace = llvm::cast<MemRefType>(dma_op.getDstMemref()
.getType()
)
.getMemorySpaceAsInt();
int src_memspace =
llvm::cast<MemRefType>(dma_op.getSrcMemref().getType())
.getMemorySpaceAsInt();
int dst_memspace =
llvm::cast<MemRefType>(dma_op.getDstMemref().getType())
.getMemorySpaceAsInt();
bool isL1Memcpy = (src_memspace == (int)air::MemorySpace::L1) ||
(dst_memspace == (int)air::MemorySpace::L1);
if (dma_op->getParentOfType<xilinx::air::HerdOp>() && isL1Memcpy) {
Expand Down Expand Up @@ -2164,9 +2162,7 @@ struct BroadcastDetection {
}
// If not variant wrt herd, then check for fixed row-wise or col-wise
// offset.
int src_memspace = llvm::cast<MemRefType>(dma_op.getSrcMemref()
.getType()
)
int src_memspace = llvm::cast<MemRefType>(dma_op.getSrcMemref().getType())
.getMemorySpaceAsInt();
auto externalOffsets = src_memspace == (int)air::MemorySpace::L1
? dma_op.getDstOffsets()
Expand Down Expand Up @@ -3937,17 +3933,17 @@ struct ShrinkMemrefSizesByAccessPattern
auto static_sizes = subViewOp.getStaticSizes();
auto static_strides = subViewOp.getStaticStrides();
// Get MemRefType after shrinkage.
Type elemType =
llvm::cast<MemRefType>(subViewOp.getSource().getType()).getElementType();
Type elemType = llvm::cast<MemRefType>(subViewOp.getSource().getType())
.getElementType();
Attribute memorySpace =
llvm::cast<MemRefType>(subViewOp.getSource().getType()).getMemorySpace();
llvm::cast<MemRefType>(subViewOp.getSource().getType())
.getMemorySpace();
auto shrunkMemrefType =
MemRefType::get(overall_access_bounds, elemType, nullptr, memorySpace);
MemRefType inferredSubViewOutputTy =
llvm::cast<MemRefType>(memref::SubViewOp::inferResultType(
shrunkMemrefType, subViewOp.getStaticOffsets(),
subViewOp.getStaticSizes(), subViewOp.getStaticStrides())
);
subViewOp.getStaticSizes(), subViewOp.getStaticStrides()));
for (unsigned i = 0; i < static_sizes.size(); i++) {
if (static_sizes[i] < 0) {
if (*getConstantIntValue(*subview_sizes++) !=
Expand Down

0 comments on commit f8460ab

Please sign in to comment.