Paul Hancock via llvm-dev
2016-Mar-16 00:59 UTC
[llvm-dev] IRBuilder Assignment ( '=' ) operator?
In my code assembly system I have the various LH-RH operators, ADD, ADDF, SUB, etc, using CreateAdd, CreateFAdd, etc, however I cant seem to locate the correct function/s for the assignment operator. What's the correct function/s in the IRBuilder for assigning a value? - Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160316/1a4fce7f/attachment.html>
Tim Northover via llvm-dev
2016-Mar-16 02:11 UTC
[llvm-dev] IRBuilder Assignment ( '=' ) operator?
Hi Paul, On 15 March 2016 at 17:59, Paul Hancock via llvm-dev <llvm-dev at lists.llvm.org> wrote:> In my code assembly system I have the various LH-RH operators, ADD, ADDF, > SUB, etc, using CreateAdd, CreateFAdd, etc, however I cant seem to locate > the correct function/s for the assignment operator.The assignment is automatic. The pointer you get back from CreateAdd can be used directly in other instructions. When this is transcribed to the textual IR, LLVM will put in the appropriate assignments (so it won't try to assign a store to anything for example, because it doesn't produce a value that can be used elsewhere). The Name parameter you pass to CreateAdd determines what variable will be assigned, otherwise an incrementing number will be used (%1, %2, ...). Cheers. Tim.
Paul Hancock via llvm-dev
2016-Mar-16 02:34 UTC
[llvm-dev] IRBuilder Assignment ( '=' ) operator?
However I need the standard assignment operator so I can assign the value of a temporary to that of another temporary, or to create a new temporary from an existing one. - Paul ________________________________________ From: Tim Northover <t.p.northover at gmail.com> Sent: 16 March 2016 13:11 To: Paul Hancock Cc: llvm-dev at lists.llvm.org Subject: Re: [llvm-dev] IRBuilder Assignment ( '=' ) operator? Hi Paul, On 15 March 2016 at 17:59, Paul Hancock via llvm-dev <llvm-dev at lists.llvm.org> wrote:> In my code assembly system I have the various LH-RH operators, ADD, ADDF, > SUB, etc, using CreateAdd, CreateFAdd, etc, however I cant seem to locate > the correct function/s for the assignment operator.The assignment is automatic. The pointer you get back from CreateAdd can be used directly in other instructions. When this is transcribed to the textual IR, LLVM will put in the appropriate assignments (so it won't try to assign a store to anything for example, because it doesn't produce a value that can be used elsewhere). The Name parameter you pass to CreateAdd determines what variable will be assigned, otherwise an incrementing number will be used (%1, %2, ...). Cheers. Tim.