Since my work involves both frontend and backend I'm sending the same message to both mailing lists.
I am in the process of implementing a direct register mapping syntax in our compiler where:
Would replace all load/stores to x with move from/to register n where n can be any valid constant integer.
The syntax recognition part in the front-end (clang) is done however, I have only been able to do this for global variables by creating metadata during parse time which include the global variable name and its assigned register , and then analyzing this metadata in ISelDAGtoDAG and perform the necessary things on GlobalVariable object to generate the right code.
However, I'm not sure what would be the best way of implementing direct register map on local variables. One thing that come to mind is to create a unique pseudo external global symbol for the local variable and use the same implementation as above, but this does not look right to me.
I'd appreciate any input/suggestion from the llvm community.