I would like to investigate the reason why the code modified is not invoking the intended assembly instruction for the instruction pattern written in .td file.
Well, that command would generate debug info that (if you compiled all the way to an executable program) would help you debug the program as it ran. I think what you want, though, is not to debug the compiled program, instead you want to debug the compiler itself.
If you remove -g from the command you showed, that should get you optimized IR, and then for instruction selection you can use the llc tool to compile the .bc file. There should be options that will help you diagnose what is going on.
Sir,
Thank you sir for your valuable suggestion
I am instructed to perform a round trip through all the files visited and print a flag like “i am here” interrogate the flow of execution through llvm back-end.
My 1st motto is to print from llvm to standard i/o.
I have tried llc to get all the passes visited.
If you build LLVM with debug-info enabled (Debug or RelWithDebInfo mode) then you should be able to use a debugger to set breakpoints in the opt or llc tools, same as any other C++ program.
Thanking you for using llc I could analyze few passes with that.The task was to give a simple program
that contains (inlined) assembly instruction and get the instructions flow inside LLVM compiler.So that I need to print from llvm.
Could you suggest a way for that sir?
llc --help-hidden | grep print shows that there are --print-before-all and --print-after-all options, which might be helpful to you. You can also selectively print before or after specific passes with --print-before=<pass-namess> and --print-after=<pass-names>.
These dumps are quite large, I think, so you probably want to capture them to a file and look at them afterward.