search for: bhagi

Displaying 5 results from an estimated 5 matches for "bhagi".

2013 Dec 04
3
[LLVMdev] Quick doubt about IR
Hi, While looking over the IR generated by my source code, I came across the following: %arr = alloca [30 x i8], align 1 In the source code this particular line of code is represented by: int arr[30]; I was wondering how I could change the capacity of arr from 30 to any other integral value via a function-pass. I know that 'alloca' can be used for reserving space on stack; further,
2013 Dec 04
0
[LLVMdev] Quick doubt about IR
...t it into the IR right before (or after) the old one, RAUW the value, then delete the old instruction. You should be able to find a variety of examples of this sort of thing in most of the IR level optimization passes. I’d look at InstCombine in particular. -Jim On Dec 4, 2013, at 1:40 PM, Shivam Bhagi <shivam.bhagi at outlook.com> wrote: > Hi, > > While looking over the IR generated by my source code, I came across the following: > > %arr = alloca [30 x i8], align 1 > > In the source code this particular line of code is represented by: > > int arr[30]; >...
2013 Dec 03
1
[LLVMdev] Help with creating and replacing instructions in LLVM
Hi, I have the following instruction in my IR- %call2 = call i8* @strcpy(i8* %1, i8* %2) #2 I intend to change call to strcpy with strncpy. I have included the following code in runOnFunction, so that when it is strcpy's turn to be invoked, strncpy is invoked instead. Assuming I* is the strcpy instruction, CallInst* x=new
2013 Dec 05
0
[LLVMdev] Help with replacing instructions via function pass
Hi, In my IR code, I have the following: %arr = alloca [30 x i8], align 1 %arraydecay = getelementptr inbounds [16 x i8]* %arr, i32 0, i32 0 %arraydecay1 = getelementptr inbounds [16 x i8]* %arr, i32 0, i32 0 I'm trying to change the capacity of arr via a function pass. I've written the following code in my function pass: ArrayType* b =
2013 Dec 06
0
[LLVMdev] ReplaceInstWithInst problem
Hi, In my source code, I have the following declaration char a[30]; When I'm running the following (Assuming that I is an instruction pointer pointing to the instruction to be replaced, i.e. %a = alloca [30 x i8], align 1): ArrayType* arr = ArrayType::get(IntegerType::get(getGlobalContext(), 8), 10); AllocaInst* pa = new AllocaInst(arr, "blah"); BasicBlock::iterator ii(*I);