[llvm-dev] Checking if pointer dependency is on function arguments

ARUN TEWATIA via llvm-dev llvm-dev at lists.llvm.org
Sun Jun 5 11:12:50 PDT 2016


Hello,

Kindly ignore previous email. Sent by accident 😛

Please consider the below llvm-ir snippet for my function: copy_string

 define void @copy_string(i8* %target, i8* %source) #0 {
 entry:
   %target.addr = alloca i8*, align 8
   %source.addr = alloca i8*, align 8
   store i8* %target, i8** %target.addr, align 8
   store i8* %source, i8** %source.addr, align 8

  %2 = load i8*, i8** %source.addr, align 8
   %3 = load i8, i8* %2, align 1
   %4 = load i8*, i8** %target.addr, align 8
    store i8 %3, i8* %4, align 1

I am trying to analyze the last instruction. I wish to correlate --  %3
 back to %source and %4 back to %target i.e. the two arguments of the
function.
In other words I wish to show that this instruction uses the two arguments
of the function.

I fetched the two operands of the instruction and looked at functions
provided by llvm for Instruction and Operand, but couldn't figure it out.

Could you please guide me with this ?

Thanks
Arun Tewatia






On Sun, Jun 5, 2016 at 7:46 PM, ARUN TEWATIA <aruntewatia87 at gmail.com>
wrote:

> Hello,
>
> Please consider the below llvm-ir snippet for my function:
>
>  define void @copy_string(i8* %target, i8* %source, i8* %test) #0 {
>  entry:
>    %target.addr = alloca i8*, align 8
>    %source.addr = alloca i8*, align 8
> store i8* %target, i8** %target.addr, align 8
> 105   store i8* %source, i8** %source.addr, align 8
>
>
>
> --
> *Arun Tewatia*
>



-- 
*Arun Tewatia*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160605/940a1c94/attachment.html>


More information about the llvm-dev mailing list