[llvm-dev] convert load with load from getElementPtr

Varun Patil via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 21 22:49:11 PST 2016


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

How to write LLVM pass to replace the above?


Thanks and Regards
Varun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161222/387f18ec/attachment.html>


More information about the llvm-dev mailing list