How to insert RUST new instruction in specific MIR statement

Hi all! I wonder that how to insert the new instruction or annotation to specific MIR statement!

I search some code in rustc(GitHub - rust-lang/rust: Empowering everyone to build reliable and efficient software.) and I found that the rust compiler generate the LLVM-IR code based on MIR in codegen directory. And the compiler check the statementKind and generate the LLVM-IR instruction(https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_ssa/src/mir/statement.rs)

I want to know that for specific statementKind( e.x: Nop,Retag) how to insert the new llvm-ir instruction containing annotation. However, I don`t know how to insert new instruction and which function call to insert new instruction.

Thank you very much! Have a nice day:)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.