Displaying 4 results from an estimated 4 matches for "call_arnamoy".
2013 Nov 05
1
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
Thanks for the reply.
For the source code:
int main()
{
int a = 0;
int *p;
p = &a;
call_arnamoy(p);
int *p1;
p1 = p;
return 1;
}
The bit code:
%retval = alloca i32, align 4
%a = alloca i32, align 4
%p = alloca i32*, align 8
%p1 = alloca i32*, align 8
store i32 0, i32* %retval
store i32 0, i32* %a, align 4
store i32* %a, i32** %p, align 8
%0 = load i32** %p, align 8
%call = call i32 @a...
2013 Oct 25
3
[LLVMdev] Question About Function Cloning
...= icmp slt i32 %0, %1
br i1 %cmp_arnamoy, label %for.body_arnamoy, label %for.end.exitStub_arnamoy
for.body_arnamoy: ; preds = %for.cond_arnamoy
%2 = load i32* %val, align 4
%inc_arnamoy = add nsw i32 %2, 1
store i32 %inc_arnamoy, i32* %val, align 4
%call_arnamoy = call i32 (i8*, ...)* @printf(i8* getelementptr
inbounds ([13 x i8]* @.str, i32 0, i32 0))
br label %for.inc_arnamoy
for.inc_arnamoy: ; preds = %for.body_arnamoy
%3 = load i32* %i1, align 4
%inc2_arnamoy = add nsw i32 %3, 1
store i32 %inc2_arnamoy, i32...
2013 Nov 05
0
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
I think I understood the problem you're trying to solve. I didn't, however,
understand the problems you are having (maybe you're not running mem2reg?).
I do have a little piece of code that I think does (more or less) what you
want.
Take a look at it, try understanding it, and see if it helps you out.
You might have to change it a bit since you're replacing uses after an
2013 Nov 05
2
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
Hello all;
So here is my goal:
*** If there is a Call instruction to myFunction(int * val), I need to
identify all the instructions that uses val in the IR and replace the
uses with a newly created pointer. I will also be changing the
argument of myFunction to the new pointer.
int * val = malloc/calloc;
...
myFunction(val);
....
*val = 45;
becomes==
int * val = malloc/calloc;
int * val1 =