virtual registers

Hi,

Is there any way to detect which virtual registers are assigned to physical registers and which ones are assigned to memory slots?

BR

Laura

At the LLVM IR level, no. However, it might be possible for a MachineFunctionPass to determine this or to modify the register allocator to record this information somewhere for query by a MachineFunctionPass later. Regards, John Criswell

Thank you for your swift reply.

I also need some reference about instruction sequence in llvm. I mean, do the order of instructions remain the same as they appear in a .ll file? or do they change by different optimizations (e.g. SSA-based Machine Code Optimizations, Late Machine Code Optimizations, etc.)?

If they change, which algorithms are used for reordering instructions? I appreciate a reference that explains them or just gives the name of the algorithms that are used.

BR

Laura

I believe there are optimizations that can change the order of instructions at the LLVM IR level. You can find a list of LLVM optimizations at . When generating native code, the Instruction Scheduler will reorder the native code instructions as well. You can look at the list of passes, but to get more detail, you will probably need to examine the source code. Regards, John Criswell