Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Bonyuk Peter. Lab 3. Option 2. #216

Merged
merged 8 commits into from
May 30, 2024

Conversation

PetrBonyuk
Copy link

This LLVM pass is a machine function pass designed for the X86 architecture. It iterates through each basic block within a given function and counts the number of non-debugging instructions. It then creates the ADD64ri32 instruction using MachineInstrBuilder, adding a counter to the global variable "ic". This pass essentially introduces additional code into the provided functions by adding these specific instructions at the end of each basic block.

Comment on lines 31 to 34
for (auto &MI : MBB) {
if (!MI.isDebugInstr())
++count;
}

Choose a reason for hiding this comment

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

Can we calculate it in a more efficient way?

@aobolensk aobolensk merged commit 0275818 into NN-complr-tech:course-spring-2024 May 30, 2024
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants