<div dir="ltr"><div>Hello llvm-dev,<br><br></div><div>Following up on the "CodeGen Context" discussion that was started, attached is patch which implements a pretty minimal skeleton of a CGContext implementation. The goal is to allow the newly added subtarget attributes on functions to be made available to codegen so that codegen can actually switch subtargets within a Module.<br>
<br>Comments and questions are invited herewith.<br><br></div><div>There has been some disagreement as to what to name this class. I have stuck with "CGContext" for now, though I'm absolutely not attached to that name.<br>
</div><div><br></div><div>It demonstrates where the CGContext state lives, how code can access it (in X86ISelLowering.cpp), how it reads the attributes from the IR, and how it gets cached.<br></div><div><br></div><div>One thing that it doesn't yet do is hook up to the target-specific subtarget feature interpretation. For example, it would need to hook up to the x86 subtarget code which knows that, for example, sse4.2 implies sse4.1, and so on. However, I'm sending this out now so that the other parts of the patch can get some feedback.<br>
<br>Thanks,<br></div><div><br></div>Dan<br><br></div>