<div dir="ltr">I am new to writing LLVM pass so please help me. I want to replace my pure load instruction like
<pre><code> %a = alloca i32, align 4
%0 = load i32, i32* %a, align 4
</code></pre>
<p>to the load from <code>getElementPtr</code> like</p>
<pre><code>%a = alloca i32, align 4
%p = alloca i32*, align 8
store i32* %a, i32** %p, align 8
%0 = load i32*, i32** %p, align 8
%1 = load i32, i32* %0, align 4
</code></pre>
<p>How to write LLVM pass to replace the above?</p><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><br></div><div><br></div>Thanks and Regards<div>Varun</div></div></div></div></div></div>
</div>