Abhinash Jain
2013-Jun-18 06:49 UTC
[LLVMdev] Getting the memory address of all operands on an expression
> in LLVM IR, the operands of most expression are registers, so don't have amemory address. Yes I agree with your this statement, But before becoming part of the expressions, the registers will actually fetch some value from memory, through Load operations. as shown in example "r3=r1+r2" will be the expression, where registers such as r1 and r2 contains (fetch) the values from the memory address b and c resp. . I want to know the way through which i can get this memory address of b and c (in hexadecimal format). -- View this message in context: http://llvm.1065342.n5.nabble.com/Getting-the-memory-address-of-all-operands-on-an-expression-tp58435p58583.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
Sean Silva
2013-Jun-18 17:31 UTC
[LLVMdev] Getting the memory address of all operands on an expression
On Mon, Jun 17, 2013 at 11:49 PM, Abhinash Jain <omnia at mailinator.com>wrote:> > But before becoming part of the expressions, the registers will actually > fetch some value from memory, through Load operations. >This is not true; the virtual registers need not be loaded from memory. You may find < http://llvm.org/docs/FAQ.html#what-api-do-i-use-to-store-a-value-to-one-of-the-virtual-registers-in-llvm-ir-s-ssa-representation> helpful. -- Sean Silva -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130618/c93b1302/attachment.html>
Abhinash Jain
2013-Jun-19 01:12 UTC
[LLVMdev] Getting the memory address of all operands on an expression
In short if suppose i have some expression as a=b+c-d*e, and with the help of LLVM pass i want to make a string like this:- "[Hexadecimal address of 'b'] [opcode of +] [Hexadecimal address of 'c'] [opcode of -] [Hexadecimal address of 'd'] [opcode of *] [Hexadecimal address of 'e']". Than how can i make it................ -- View this message in context: http://llvm.1065342.n5.nabble.com/Getting-the-memory-address-of-all-operands-on-an-expression-tp58435p58616.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
Duncan Sands
2013-Jun-19 06:05 UTC
[LLVMdev] Getting the memory address of all operands on an expression
On 18/06/13 19:31, Sean Silva wrote:> > > > On Mon, Jun 17, 2013 at 11:49 PM, Abhinash Jain <omnia at mailinator.com > <mailto:omnia at mailinator.com>> wrote: > > But before becoming part of the expressions, the registers will actually > fetch some value from memory, through Load operations. > > This is not true; the virtual registers need not be loaded from memory. You may > find > <http://llvm.org/docs/FAQ.html#what-api-do-i-use-to-store-a-value-to-one-of-the-virtual-registers-in-llvm-ir-s-ssa-representation> > helpful.If it is loaded from memory you may be able to get hold of the load instruction using GetUnderlyingObject or GetUnderlyingObjects (see include/llvm/Analysis/ValueTracking.h), as I think I mentioned already in my first reply. Ciao, Duncan.
Seemingly Similar Threads
- [LLVMdev] Getting the memory address of all operands on an expression
- [LLVMdev] Getting the memory address of all operands on an expression
- [LLVMdev] LLVM ERROR : Invalid instruction
- [LLVMdev] LLVM ERROR : Invalid instruction
- [LLVMdev] Getting the memory address of all operands on an expression