comparing IR instruction within different basic blocks

Hello all,

What is the best way to compare IR instructions in one basic block to another one’s?

Thank you,



in what sense?

comparing arithmetical operations in a function’s IR to operations in another function’s IR. I want to see they share similar arithmetic opcode, I don’t care about their sequence at this time.




If you want just the opcode you a can get it from the instruction. What is the actual question?

Take a look at llvm-diff:

I don't use it by myself, so I cannot give any advice/help about it.


The question seems to be cryptic to me as well.
Do you want to do it during code generation or after the code is generated (like binary to binary comparison)?