title: In LLVM IR, how to get the pointee Value of a pointer type?
body: <p>I am writing a pass to do constant folding.
  Like this C code:</p>
  
  <pre><code>int a = 4;
  int b = a + 5;
  </code></pre>
  
  <p>I want to transform it to:</p>
  
  <pre><code>int b = 4 + 5;
  </code></pre>
  
  <p>But the first segment of code will generate an instruction for <code>int a</code>:</p>
  
  <pre><code>store i32 4, i32* %a, align 4
  </code></pre>
  
  <p>How can I get the Value "%a" from this pointer "i32* %a" in my Pass?
  So that I can replace all use of the Value %a to the ConstantInt ?</p>