mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-26 14:48:43 +00:00
IROpt: Port get/set elimination pass to current IR
This commit is contained in:
@@ -87,6 +87,18 @@ void Inst::Invalidate() {
|
||||
}
|
||||
}
|
||||
|
||||
void Inst::ReplaceUsesWith(Value& replacement) {
|
||||
Invalidate();
|
||||
|
||||
op = Opcode::Identity;
|
||||
|
||||
if (!replacement.IsImmediate()) {
|
||||
Use(replacement);
|
||||
}
|
||||
|
||||
args[0] = replacement;
|
||||
}
|
||||
|
||||
void Inst::Use(Value& value) {
|
||||
value.GetInst()->use_count++;
|
||||
|
||||
|
||||
@@ -148,6 +148,8 @@ public:
|
||||
|
||||
void Invalidate();
|
||||
|
||||
void ReplaceUsesWith(Value& replacement);
|
||||
|
||||
size_t use_count = 0;
|
||||
Inst* carry_inst = nullptr;
|
||||
Inst* overflow_inst = nullptr;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// opcode name, return type, arg1 type, arg2 type, arg3 type, ...
|
||||
|
||||
OPCODE(Identity, T::Opaque, T::Opaque )
|
||||
|
||||
// ARM Context getters/setters
|
||||
OPCODE(GetRegister, T::U32, T::RegRef )
|
||||
OPCODE(SetRegister, T::Void, T::RegRef, T::U32 )
|
||||
|
||||
Reference in New Issue
Block a user