[llvm-dev] convert load with load from getElementPtr

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 21 23:03:57 PST 2016


> On Dec 21, 2016, at 10:49 PM, Varun Patil via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> I am new to writing LLVM pass so please help me. I want to replace my pure load instruction like
>  %a = alloca i32, align 4
>  %0 = load i32, i32* %a, align 4
> to the load from getElementPtr like
> 
> %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

Where is the getElementPtr?

— 
Mehdi



> How to write LLVM pass to replace the above?
> 
> 
> 
> Thanks and Regards
> Varun
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161221/ed07266f/attachment.html>


More information about the llvm-dev mailing list