search for: ptrtointinst

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

2011 Jul 31
3
[LLVMdev] SwitchInst::addCase with BlockAddress
...;m trying to figure out how to feed a blockaddress to a switch condition AND destination (basically emulating an indirectbr via a switch; I know it's not a good approach, I'm just experimenting). Suppose I have the following: SwitchInst *s = SwitchInst::Create(...); BasicBlock *bb = ...; PtrToIntInst k = new PtrToIntInst(BlockAddress::get(bb), <TYPE>, "", s); s->addCase(k, bb); ... is this reasonable? what should I put in place of <TYPE> (the type to cast to)? -- Carlo Alberto Ferraris <cafxx at strayorange.com <mailto:cafxx at strayorange.com>> website/...
2011 Aug 01
0
[LLVMdev] SwitchInst::addCase with BlockAddress
...eed a blockaddress to a switch condition > AND destination (basically emulating an indirectbr via a switch; I know it's > not a good approach, I'm just experimenting). > Suppose I have the following: > > SwitchInst *s = SwitchInst::Create(...); > BasicBlock *bb = ...; > PtrToIntInst k = new PtrToIntInst(BlockAddress::get(bb), <TYPE>, "", s); > s->addCase(k, bb); > ... > > is this reasonable? what should I put in place of <TYPE> (the type to cast > to)? You can't do that; switch cases are required to be constant integers, and a block...
2011 Aug 01
1
[LLVMdev] SwitchInst::addCase with BlockAddress
...ch condition >> AND destination (basically emulating an indirectbr via a switch; I know it's >> not a good approach, I'm just experimenting). >> Suppose I have the following: >> >> SwitchInst *s = SwitchInst::Create(...); >> BasicBlock *bb = ...; >> PtrToIntInst k = new PtrToIntInst(BlockAddress::get(bb),<TYPE>, "", s); >> s->addCase(k, bb); >> ... >> >> is this reasonable? what should I put in place of<TYPE> (the type to cast >> to)? > > You can't do that; switch cases are required to be c...
2011 Feb 17
2
[LLVMdev] Getting load/store byte size
...For example, say that I'm reading a local variable 'a': %1 = load i32* %a, align 4 I need to know the address of the variable 'a' and the size. Of course, memory loads/stores could be from general GEP or global variables. Getting the address was easily doable by using "PtrToIntInst(load_inst->getPointerOperand(), ...)". However, getting load/store size wasn't that straight forward. In this example, it should be four bytes. I tried to get the Type* from the getPointerOperand() and tried to retrieve the size of the type, but failed. Question: [1] How can I retrieve...
2012 Jul 31
0
[LLVMdev] rotate
Oh, no. I should have been more clear. The patch was not rejected, just lost in the daily shuffle. I already have my employer's approval to send this upstream, so I will prepare a patch against trunk this morning. > I proposed a similar patch to LLVM (left circular shift) around 10/2011. > > Parts of my patch did make it into trunk about a year after, but others > > did not.
2012 Jul 31
4
[LLVMdev] rotate
On Monday, July 30, 2012 12:16 AM, Cameron McInally wrote: > Hey Andy, > > I proposed a similar patch to LLVM (left circular shift) around 10/2011. > Parts of my patch did make it into trunk about a year after, but others > did not. > > At that time, my solution was to add a binary operator to the IRBuilder, > since LCS fits in nicely with the other shift operators. But,
2012 Jul 31
3
[LLVMdev] rotate
..., UIToFPInst ) // UInt -> floating point -HANDLE_CAST_INST(39, SIToFP , SIToFPInst ) // SInt -> floating point -HANDLE_CAST_INST(40, FPTrunc , FPTruncInst ) // Truncate floating point -HANDLE_CAST_INST(41, FPExt , FPExtInst ) // Extend floating point -HANDLE_CAST_INST(42, PtrToInt, PtrToIntInst) // Pointer -> Integer -HANDLE_CAST_INST(43, IntToPtr, IntToPtrInst) // Integer -> Pointer -HANDLE_CAST_INST(44, BitCast , BitCastInst ) // Type cast - LAST_CAST_INST(44) + FIRST_CAST_INST(34) +HANDLE_CAST_INST(34, Trunc , TruncInst ) // Truncate integers +HANDLE_CAST_INST(35, ZExt...