Getting the total number of cycles that a function would perform in LLVM

Suppose I have a function presented in LLVM IR, and I want to estimate the number of cpu cycles that this function will execute on my machine.

I know that this is architecture-specific information, but I want to get a rough estimate of this for some planning purposes.

Is it possible to write a skip that iterates over instructions in a function and returns the total number of loops that these instructions will execute?

Would thank for any ideas.

Thanks,

Kayhan

+4
source share
1 answer

CostModel. , codegen , , - .

:

. LLVM-IR. codegen IR . , , , .. .

+4

All Articles