search for: state_1

Displaying 3 results from an estimated 3 matches for "state_1".

2015 Feb 05
5
[LLVMdev] RFC: Recursive inlining
...Is a node N the first recursive call? or the second? Call-stack recursion can save two things: the state of variables and the return address which serves as another kind of state. The obvious answer is to turn this into a sort of state machine: cnt = 0 stack[cnt++] = i; stack[cnt++] = STATE_1; while (1) { state = stack[--cnt]; i = stack[--cnt]; if (state == STATE_FINISH) { h(i); continue; } if (is_base(i)) { f(); continue; } g(i); stack[cnt++] = i; // Push ourself again, in the final state this time sta...
2015 Feb 05
5
[LLVMdev] RFC: Recursive inlining
...cursion can save two things: the state of > > variables and the return address which serves as another kind of > > state. The obvious answer is to turn this into a sort of state > > machine: > > > > > > cnt = 0 > > stack[cnt++] = i; > > stack[cnt++] = STATE_1; > > while (1) { > > state = stack[--cnt]; > > i = stack[--cnt]; > > > > > > if (state == STATE_FINISH) { > > h(i); > > continue; > > } > > > > > > if (is_base(i)) { > > f(); continue; > > } > > > > >...
2015 Feb 18
5
[LLVMdev] RFC: Recursive inlining
...n save two things: the > > state of variables and the return address which serves as another > > kind of state. The obvious answer is to turn this into a sort of > > state > > machine: > > > > > > cnt = 0 > > stack[cnt++] = i; > > stack[cnt++] = STATE_1; > > while (1) { > > state = stack[--cnt]; > > i = stack[--cnt]; > > > > > > if (state == STATE_FINISH) { > > h(i); > > continue; > > } > > > > > > if (is_base(i)) { > > f(); continue; > > } > > > > >...