Seung Jae Lee
2006-Dec-20 10:44 UTC
[LLVMdev] Instructions having variable names as operands
Dear Mr. Lattner: You have asked me how my instruction set works. If I code like this: int foo1() { int x1,x2; x1 =1; x2 = foo2(x1); return x2; } int foo2(int k) { if(k == 1) k = 2; return k; } int main () { int j; j = foo1(); } This should be emitted like this: Enter foo1; reg x2, x1 add 1;x1 Call foo2;x1,x2 Exit foo1; x2 Enter foo2; k reg temp0:1 cmp k,1;temp0 demultiplex m0;temp0;b1;b0 branch b0 add 2;k unbranch b0 branch b1 unbranch b1 mux m0 Exit foo2; k I am not sure about full source language scoping rules you mentioned. Would you mind telling me about that? Thank you very much. Seung Jae Lee
Chris Lattner
2006-Dec-20 19:22 UTC
[LLVMdev] Instructions having variable names as operands
On Wed, 20 Dec 2006, Seung Jae Lee wrote:> I am not sure about full source language scoping rules you mentioned. Would you mind telling me about that? > Thank you very much.I the example I gave, variable scoping rules allow you to have multiple different varibles with the same name. How do you handle this? -Chris -- http://nondot.org/sabre/ http://llvm.org/
Apparently Analagous Threads
- [LLVMdev] Instructions having variable names as operands
- [LLVMdev] Instruction sets requiring more than 3 operands
- How to move an internal function to external keeping same environment?
- potential file.copy() or documentation bug when copy.date = TRUE
- Test for argument in ...