Skip to content

Дормидонтов Егор. Лабораторная работа 4. MLIR. Вариант 4. #194

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

Open
wants to merge 1 commit into
base: course-spring-2025
Choose a base branch
from

Conversation

EgorDormidontov
Copy link

Данный пасс вычисляет максимальную глубину вложенности региональных операторов внутри каждой функции в модуле.

Для каждой функции пасс рекурсивно проходит по всем регионам и находит максимальный уровень вложенности.

Comment on lines +53 to +54
llvm::outs() << "Func " << funcOp.getName()
<< ": max_loop_region_depth = " << maxDepth << "\n";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
llvm::outs() << "Func " << funcOp.getName()
<< ": max_loop_region_depth = " << maxDepth << "\n";

}
return
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add the test where scf.for is not top level in the function, e.g.:

func() {
  scf.if ... {
    scf.for {
    }
  }
}

@@ -0,0 +1,54 @@
// RUN: mlir-opt -load-pass-plugin=%mlir_lib_dir/MaxLoopRegionDepthPass_Dormidontov_Egor_FIIT2_MLIR%shlibext \
// RUN: --pass-pipeline="builtin.module(MaxLoopRegionDepthPass_Dormidontov_Egor_FIIT2_MLIR)" %s | FileCheck %s

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have an implementation for affine loops, but do not have tests for them


// ###Цикл с if внутри и if во вложении, глубина = 3
// CHECK-LABEL: func.func @deep_nest
// CHECK: attributes {max_loop_region_depth = 3 : i32}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your tests do not check that attributes attached to the right loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants