[LLVMdev] regarding getelementptr

Duncan Sands baldrick at free.fr
Fri Dec 4 12:26:28 PST 2009


Hi Arvind,

> I have been working towards generating my own IR code from llvm IR. I
> have hit a stumbling block with respect to "getelementptr" used inside
> another llvm instruction.
> 
> Example: %arrayidx = getelementptr inbounds i32* getelementptr
> inbounds ([10 x i32]* @k, i32 0, i32 0), i32 %tmp2 ; <i32*> [#uses=1]
> 
> I am unable to get a handle on the second "getelementptr" in this instruction.

I'm not sure what you are asking, but the inner getelementptr is a constant
(ConstantExpr), only constants turn up nested like this.

Ciao,

Duncan.



More information about the llvm-dev mailing list