search for: weixuegong

Displaying 7 results from an estimated 7 matches for "weixuegong".

2013 Sep 06
1
[LLVMdev] How to get the exact integer from a Value
...in IRBuilder or other class to generate "getelementptr"?). I searched for a while, but I found nothing. I will appreciate if you could give me some suggestion on this. Thank you. >> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] >> On Behalf Of weixuegong >> Subject: [LLVMdev] How to get the exact integer from a Value >> I have a Value* type named indexValue, and the type is i32. >> I think "indexValue" must hold a number which type is int. > Correct, but it might not be a constant. > >> ConstantInt* CI = llvm...
2013 Sep 06
0
[LLVMdev] How to get the exact integer from a Value
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of weixuegong > Subject: [LLVMdev] How to get the exact integer from a Value > I have a Value* type named indexValue, and the type is i32. > I think "indexValue" must hold a number which type is int. Correct, but it might not be a constant. > ConstantInt* CI = llvm::cast<llvm::Constan...
2013 Sep 13
1
[LLVMdev] Confuse on ptrtoint and load
Hi, all When I read the document of IR on llvm.org, I found two instructions, "ptrtoint" and load. Load, I think, is : when after allocating some bytes in memory and storing some data into it, we could use load to get the data, like this: %0 = alloca i32 store i32 5, i32* %0 %1 = load i32* %0 so, the type of %1 is i32, and the value is 5, right? And "ptrtoint" is:we cast it
2013 Sep 06
2
[LLVMdev] How to get the exact integer from a Value
Hi,all I have a Value* type named indexValue, and the type is i32. I think "indexValue" must hold a number which type is int. Now I want to use the exact number which pointed by indexValue , so I do like this: ConstantInt* CI = llvm::cast<llvm::ConstantInt>(indexValue); //This is wrong, so is dyn_cast. uint64_t index = indexValue->getZExtValue(); uint64_t size = index + 1; I
2013 Sep 16
1
[LLVMdev] Is GEP safe if not know the size of an array?
Hi, all I am trying to use GEP to get a pointer of i32 from an array. But the problem is: I don't know the size of the array. The IR document on llvm.org said GEP just adds the offsets to the base address with silently-wrapping two’s complement arithmetic. So, I want to ask for some advice. Is it safe like this: %v1 = alloca i32 store i32 5, i32* %v1 %6 = load i32* %v1 %7 = bitcast i32* %v0
2013 Sep 24
1
[LLVMdev] Question on bit layout of array after bitcasting in llvm
Hi, all I get some code: %0 = bitcast i16 %arg1 to <2 x i8> %2 = extractelement <2 x i8> %0, i32 1 %arg1 in mem : 0000000011111111 |---8bit---| |---8bit---| After bitcasting, %0 is an ptr to vector. So is %0 also the address of the first element of the vector? And what is %2 exactly? Is it the second element of vector(11111111) or, 00000000? I'll be very grateful if someone
2013 Sep 30
1
[LLVMdev] Will it be slow much if a lot of BasicBlock been created?
Hi, all I am doing some work about instruction translating. and the IR is sort of:(whatever it is) %v1 = alloca i32 store i32 10, i32* %v1 %v0 = alloca i32 store i32 0, i32* %v0 %0 = load i32* %v0 %1 = add i32 %0, 1 store i32 %1, i32* %v0 %2 = load i32* %v1 %3 = add i32 %2, -1 store i32 %3, i32* %v1 %4 = load i32* %v0 ret i32 %4 I want to know that if I create a basic block for every instruction