-
Notifications
You must be signed in to change notification settings - Fork 55
Дормидонтов Егор. Лабораторная работа 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
base: course-spring-2025
Are you sure you want to change the base?
Дормидонтов Егор. Лабораторная работа 4. MLIR. Вариант 4. #194
Conversation
llvm::outs() << "Func " << funcOp.getName() | ||
<< ": max_loop_region_depth = " << maxDepth << "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
llvm::outs() << "Func " << funcOp.getName() | |
<< ": max_loop_region_depth = " << maxDepth << "\n"; |
} | ||
return | ||
} | ||
|
There was a problem hiding this comment.
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 | |||
|
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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
Данный пасс вычисляет максимальную глубину вложенности региональных операторов внутри каждой функции в модуле.
Для каждой функции пасс рекурсивно проходит по всем регионам и находит максимальный уровень вложенности.