title: Write or Read Instructions in LLVM
body: <p>I just wanted to make sure I understand getOperand() right. It seems like getOperand() return operands in a reverse order:</p>
  
  <p>so if I have:</p>
  
  <pre><code>%1 = mul nsw i32 7, 2          # The c source code is: a = 7; b = a*2
  ret i32 %1                     # The c source code is: return a;
  </code></pre>
  
  <p>Correct me if I'm wrong:</p>
  
  <p>In the first instruction, getOperand(0) gives me 'i32' (what is being read) and getOpernad(1) 'nsw' (what is being written to).</p>
  
  <p>In the second instruction, the only operand is i32 which is being read.</p>
  
  <p>So I guess my question is, if the instruction is writing to something, is it the last operand?  </p>