title: How can I get the opcode length of an IR instruction in LLVM
body: <p>I need to get the offset and the exact length of opcode corresponding to a particular LLVM IR instruction in x86 architecture. I believe for this I must hack in backends. </p>
  
  <p>I assume there is a way when the opcodes are being generated in x86 backend to dump their offsets and sizes. 
  However, considering optimizations and translation of one IR instruction to multiple operations, I'm not sure whether the relation between a single IR instruction and its corresponding opcode is maintainable or not.</p>
  
  <p>My questions are:</p>
  
  <ul>
  <li>Is this in general possible?</li>
  <li>How to hack the backend to dump the required informations? Is there a generic way to do so, or do I need to hack all backends?</li>
  </ul>