I am so happy to join the LLVM email list to share some ideas and discuss technical problems. As listed in the topic, I was trying to insert a NOP instruction in a program by modifying the compiler.
I read through the documentation about the backend of LLVM. However, it is too general to implement this. Can someone give me some advice on this?
For you,the best way I think to start is to run llc to translate an ir file,which can be generated by clang with an existing C source,to a cppbackend output.Then you can know how instructions are built.
you might also want to have a look at this thread on randomizing
compilation by inserting NOPs (and other techniques):