[LLVMdev] Transforming ConstantExprs to Instructions

Matthijs Kooijman matthijs at stdin.nl
Wed Jun 18 01:36:49 PDT 2008


Hi Chris,

> > [ Snip replacing constantexprs with instructions ] 
> Ok, this is not possible in general though, global variable initializers 
> have to be constants, not instructions.
Yeah, so if not all uses can be replaced, my pass will just have to skip the
variable.

> Is it possible to design the pass to work with both?  The general approach 
> is to make stuff handle "User"s instead of Instructions.  It is much more 
> compile time efficient to just handle the two forms rather than converting 
> them back and forth.
With both I assume you mean both GEP instrs and GEP constantexprs? If so then
yes, I am intending to make it work with both, and that's exactly why I need
to convert the constantexprs to instructions (Since, unless I'm very much
mistaken, a gepconstantexpr won't work with an alloca, so I can't leave them
intact).

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080618/9efea1a7/attachment.sig>


More information about the llvm-dev mailing list