I am working on a tool that takes the LLVM IR and modifies it. I’m interested in allowing the programmer to give hints to the compiler. For example, he can give the hint that a particular loop is compute intensive. For this purpose, one thing that comes to my mind is to use a pragma. So my question is, how can we make the pragmas work? Can I have the pragma information there in the LLVM IR? What are the options for such kind of task?
Share
This question can refer to several different things:
pragma, take a look at how Clang does it. I.e. what variouspragmadirectives are translated to.inlinehint,byvaletc.), look at attributes – for example Function Attributes.