Eric Fisher <joefoxr...@gmail.com> writes: > I'd like to get more helpful information from the final .S file, such > as basic block info, so that I can draw a cfg graph through a script.
The basic block information and the CFG graph is not reliable at that point in the compilation. Your patch will work reliably for some targets and optimization levels but not for others. The CFG information is messed up by the machine dependent reorg pass and the delay slot pass. I would be worried about confusing people. > Also, I think it will be better to generate one label for each basic > block, and the local label should have the function name as the > suffix. Because some profile tools, such as oprofile, will output > samples based on the labels. So this will help us to analyze the > samples for each basic block. But current generated code will have > many local labels with the same name. Perhaps it's again the > -fverbose-asm to enable this functionality. But where should I go if I > wanna implement this functionality? The local labels used for blocks are normally discarded by the assembler and thus are never seen by tools like oprofile. Using named symbols for basic blocks seems like a reasonable option if it will indeed give better information from oprofile, but it should be an option separate from -fverbose-asm. The labels in RTL are CODE_LABEL insns, so you would want to change the way that they are emitted in final_scan_insn. The fact that there can be several CODE_LABELs in sequence doesn't seem to matter too much, since only one will be picked up by profiling tools. To be clear, I would want to see that you really do get better results from profiling tools before accepting such a patch. Ian