mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2025-12-28 10:15:00 +01:00
Implement some simple IR optimizations (get/set eliminiation and DCE)
This commit is contained in:
parent
90d317b868
commit
5fbfc6c155
16 changed files with 544 additions and 300 deletions
|
|
@ -141,10 +141,13 @@ Gen::X64Reg RegAlloc::UseScratchRegister(IR::Value* use_value, std::initializer_
|
|||
|
||||
if (IsRegisterOccupied(new_location)) {
|
||||
SpillRegister(new_location);
|
||||
if (current_location != new_location) {
|
||||
code->MOV(32, Gen::R(hostloc_to_x64.at(new_location)), Gen::R(hostloc_to_x64.at(current_location)));
|
||||
}
|
||||
} else {
|
||||
code->MOV(32, Gen::R(hostloc_to_x64.at(new_location)), Gen::R(hostloc_to_x64.at(current_location)));
|
||||
}
|
||||
|
||||
code->MOV(32, Gen::R(hostloc_to_x64.at(new_location)), Gen::R(hostloc_to_x64.at(current_location)));
|
||||
|
||||
hostloc_state[new_location] = HostLocState::Scratch;
|
||||
remaining_uses[use_value]--;
|
||||
} else {
|
||||
|
|
@ -203,6 +206,9 @@ void RegAlloc::HostCall(IR::Value* result_def, IR::Value* arg0_use, IR::Value* a
|
|||
ScratchRegister({AbiArgs[i]});
|
||||
}
|
||||
}
|
||||
|
||||
ScratchRegister({HostLoc::RSP});
|
||||
code->MOV(64, Gen::R(Gen::RSP), Gen::MDisp(Gen::R15, offsetof(JitState, save_host_RSP)));
|
||||
}
|
||||
|
||||
HostLoc RegAlloc::SelectARegister(std::initializer_list<HostLoc> desired_locations) const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue