Dear, I have the following problem. I am given 2 instructions say I1 and I2 whose selection should depend on the operands. Say the operands have a boolean attribute 'attr'. I would like to select I1 and I2 by some logic that involves the 'attr' attribute of all the operands involved. eg: If all operands have attr set to True, I want I1 to be selected to operate else I2. How can I add an attribute to the operands? How will the values of these attributes be set? How should to select the instructions based on the logic? -- Pratik -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140610/c1ed3556/attachment.html>
Hi Pratik, On 10 June 2014 06:38, pratik dand <pratikdand143 at gmail.com> wrote:> Say the operands have a boolean attribute 'attr'. I would like to select I1 > and I2 by some logic that involves the 'attr' attribute of all the operands > involved.What does this attribute represent? It's possible LLVM already has an analogue and uses a different way to get the right code out. In general operands don't have many intrinsic attributes: type is the main one. Though different kinds of operands have more information attached. Cheers. Tim.
Dear Tim, I am working on a cryptography project. So I need the operand to have a boolean attribute say Encrypted. If the operands are encrypted I want to use say ADD* instruction else the the ADD instruction. I was hoping to find answers for How to add a new instruction to the backend and how to modify the ISel mechanism such that the above requirement is fulfilled. Regards, Pratik On Tue, Jun 10, 2014 at 8:21 PM, Tim Northover <t.p.northover at gmail.com> wrote:> Hi Pratik, > > On 10 June 2014 06:38, pratik dand <pratikdand143 at gmail.com> wrote: > > Say the operands have a boolean attribute 'attr'. I would like to select > I1 > > and I2 by some logic that involves the 'attr' attribute of all the > operands > > involved. > > What does this attribute represent? It's possible LLVM already has an > analogue and uses a different way to get the right code out. > > In general operands don't have many intrinsic attributes: type is the > main one. Though different kinds of operands have more information > attached. > > Cheers. > > Tim. >-- Pratik -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140611/f6fca282/attachment.html>