Removes the EndFunction IR Op

This commit is contained in:
Ryan Houdek 2019-11-04 05:33:53 -08:00 committed by Stefanos Kornilios Mitsis Poiitidis
parent 9218df31c2
commit f8b858e7fc
7 changed files with 14 additions and 21 deletions

View File

@ -156,8 +156,7 @@ void InterpreterCore::ExecuteCode(FEXCore::Core::InternalThreadState *Thread) {
Thread->State.State.rip += Op->RIPIncrement;
break;
}
case IR::OP_EXITFUNCTION:
case IR::OP_ENDFUNCTION: {
case IR::OP_EXITFUNCTION: {
Quit = true;
break;
}

View File

@ -403,8 +403,7 @@ void *JITCore::CompileCode([[maybe_unused]] FEXCore::IR::IRListView<true> const
}
break;
}
case IR::OP_EXITFUNCTION:
case IR::OP_ENDFUNCTION: {
case IR::OP_EXITFUNCTION: {
if (SpillSlots) {
add(sp, sp, SpillSlots * 16);
}

View File

@ -352,8 +352,7 @@ void *JITCore::CompileCode([[maybe_unused]] FEXCore::IR::IRListView<true> const
}
break;
}
case IR::OP_EXITFUNCTION:
case IR::OP_ENDFUNCTION: {
case IR::OP_EXITFUNCTION: {
if (SpillSlots) {
add(rsp, SpillSlots * 16);
}
@ -382,7 +381,7 @@ void *JITCore::CompileCode([[maybe_unused]] FEXCore::IR::IRListView<true> const
mov(al, 1);
xchg(byte [STATE + offsetof(FEXCore::Core::ThreadState, RunningEvents.ShouldStop)], al);
// This code matches what is in EXITFUNCTION/ENDFUNCTION
// This code matches what is in EXITFUNCTION
if (SpillSlots) {
add(rsp, SpillSlots * 16);
}
@ -1684,7 +1683,6 @@ void *JITCore::CompileCode([[maybe_unused]] FEXCore::IR::IRListView<true> const
case IR::OP_BEGINBLOCK:
case IR::OP_ENDBLOCK:
case IR::OP_EXITFUNCTION:
case IR::OP_ENDFUNCTION:
case IR::OP_BREAK:
case IR::OP_JUMP:
break;

View File

@ -803,8 +803,7 @@ void LLVMJITCore::HandleIR(FEXCore::IR::IRListView<true> const *IR, IR::NodeWrap
JITState.IRBuilder->CreateBr(JITCurrentState.ExitBlock);
break;
}
case IR::OP_EXITFUNCTION:
case IR::OP_ENDFUNCTION: {
case IR::OP_EXITFUNCTION: {
JITState.IRBuilder->CreateBr(JITCurrentState.ExitBlock);
break;
}

View File

@ -38,6 +38,13 @@
"Next"
]
},
"BeginBlock": {},
"EndBlock": {
"Args": [
"uint64_t", "RIPIncrement"
]
},
"Constant": {
"HasDest": true,
"FixedDestSize": "8",
@ -45,12 +52,6 @@
"uint64_t", "Constant"
]
},
"BeginBlock": {},
"EndBlock": {
"Args": [
"uint64_t", "RIPIncrement"
]
},
"Break": {
"Args": [
@ -59,7 +60,6 @@
]
},
"EndFunction": {},
"ExitFunction": {},
"Jump": {

View File

@ -57,7 +57,6 @@ bool DeadCodeElimination::Run(OpDispatchBuilder *Disp) {
// Control flow
case OP_BREAK:
case OP_JUMP:
case OP_ENDFUNCTION:
case OP_EXITFUNCTION:
case OP_CONDJUMP:
// Keep
@ -100,4 +99,4 @@ FEXCore::IR::Pass* CreatePassDeadCodeElimination() {
}
}
}

View File

@ -88,8 +88,7 @@ bool IRValidation::Run(OpDispatchBuilder *Disp) {
}
switch (IROp->Op) {
case IR::OP_EXITFUNCTION:
case IR::OP_ENDFUNCTION: {
case IR::OP_EXITFUNCTION: {
CurrentBlock->HasExit = true;
break;
}