Skip to content

Кошкин Никита. Лабораторная работа 3: BACKEND. Вариант 2. #195

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

NikitaKoshkin
Copy link

Пасс для LLVM, который после каждой найденной SIMD-инструкции в MIR добавляет инкремент глобального счётчика. Используется для подсчёта числа выполненных векторных инструкций.
Для обнаружения SIMD-инструкций пасс сравнивает имена опкодов с набором наиболее часто используемых SIMD-инструкций (понимаю, что не оптимально, поэтому ожидаю ревью на эту тему...).

Comment on lines +244 to +249
for (const auto &opcode : simd_opcodes) {
if (OpcodeName == opcode) {
isSimd = true;
break;
}
}

Choose a reason for hiding this comment

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

Consider using hash set or tree set data structure for better lookup (for instance, DenseSet) and you can replace this loop with a condition that would check if instruction is in SIMD scope or not

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