search for: state_finish

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

2015 Feb 05
5
[LLVMdev] RFC: Recursive inlining
...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 > > stack[cnt++] = STATE_FINISH; > &gt...
2015 Feb 05
5
[LLVMdev] RFC: Recursive inlining
...he 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 stack[cnt++] = STATE_FINISH; stack[cnt++] = i / 2 + 1; stack[cnt++] = STATE_1; stack[cn...
2015 Feb 18
5
[LLVMdev] RFC: Recursive inlining
...s 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 stack[cnt++] = STATE_FINISH; stack[cn...