[llvm-dev] drop operand

John Criswell via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 13 10:04:03 PDT 2015


On 8/13/15 6:11 AM, Alexander Poddey via llvm-dev wrote:
> Hi all,
>
> if I have a getElemtPrt instruction, acessing e.g. a datafield of a struct,
> like I32 0, i64 1, i32 3, the instructin has 4 operands (the value and the
> index sequence).
>
> Suppose I want to alter the instruction to access an array, I would neet only
> 2 indices instead of three. How can I correct the instruction for this?
> I could setOpernad 0 - 2, and would need to delete Operand 3.
> simply by pop_back the operand list?

The easiest thing to do would be to create a new GEP instruction that 
has all of the operands of the original GEP except for the operand that 
you want to delete.  You should then replace all uses of the old GEP 
with the new GEP.

Regards,

John Criswell

>
> Thx
> Alex.
>
> Btw.: is the llvm-dev list available vial news server, and if so on which?
> Up to now I used g.comp.compiler.llvm.devel which is the old an not the new
> llvm-dev.
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org         http://llvm.cs.uiuc.edu
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
http://www.cs.rochester.edu/u/criswell



More information about the llvm-dev mailing list