Konstantinos Parasyris
2014-Jul-20 11:49 UTC
[LLVMdev] LLVM Metadata from Pass to Backend optimization
Hello, I am new in the LLVM infrastructure and I want to write a pass which creates extra information for each instruction. This information is going to be used by a back-end optimization. I am thinking of using the Metadata structure to pass the data from the Analysis Pass to the Back end. Is this the correct methodology? Or should I use another mechanism? Konstantinos Parasyris.
John Criswell
2014-Jul-20 16:47 UTC
[LLVMdev] LLVM Metadata from Pass to Backend optimization
On 7/20/14, 6:49 AM, Konstantinos Parasyris wrote:> Hello, > > I am new in the LLVM infrastructure and I want to write a pass which > creates extra information for each instruction. This information is > going to be used by a back-end optimization. I am thinking > of using the Metadata structure to pass the data from the Analysis > Pass to the Back end. Is this the correct methodology? Or should I use > another mechanism?If a MachineFunctionPass can require a "regular" LLVM pass (such as a FunctionPass or ModulePass), then I would simply write the pass which creates the extra information as an LLVM analysis pass and give it methods which the MachineFunctionPass can use to query the extra information. This ensures that transformations between the time you do the analysis and the time you do code generation don't invalidate your results. If that's too difficult, then I think adding Metadata would work. It's just not the approach I'd take. Regards, John Criswell> > Konstantinos Parasyris. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev