[LLVMdev] Move instruction

Owen Anderson resistor at mac.com
Fri Nov 14 21:22:32 PST 2008


On Nov 14, 2008, at 9:13 PM, Karhu, Abhinav R wrote:

> Hi Eli,
> I want to do redundant load elimination. A simple example for that  
> would be
>
> load (a1) , r1;
> ---
> ---
> ---
> load (a2) , r2;
>
> Now if a1 and a2 are alias of each other and the value stored in a1  
> and a2 remains the same then I can say that the second load is  
> redundant.
> I can replace the second load with these instructions
>
> mov r0 r1;
> mov r0 r2; and remove the load instruction.
>

You don't need to copy r1.  Just replace all uses of r2 with r1, and  
get rid of the definition of r2.

--Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2624 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081114/e7d0d045/attachment.bin>


More information about the llvm-dev mailing list