<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 21, 2016, at 10:49 PM, Varun Patil via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I am new to writing LLVM pass so please help me. I want to replace my pure load instruction like
<pre class=""><code class=""> %a = alloca i32, align 4
%0 = load i32, i32* %a, align 4
</code></pre><p class="">to the load from <code class="">getElementPtr</code> like</p>
<pre class=""><code class="">%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></div></div></blockquote><div><br class=""></div><div>Where is the getElementPtr?</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><p class="">How to write LLVM pass to replace the above?</p><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><br class=""></div>Thanks and Regards<div class="">Varun</div></div></div></div></div></div>
</div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>