mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-22 04:35:46 +00:00
glasm: Fix aliased bitcasts ref counting
This commit is contained in:
parent
f1b334b9f9
commit
fb3ba62b3a
3 changed files with 42 additions and 13 deletions
|
@ -12,12 +12,10 @@ static void Alias(IR::Inst& inst, const IR::Value& value) {
|
|||
if (value.IsImmediate()) {
|
||||
return;
|
||||
}
|
||||
IR::Inst* const value_inst{value.InstRecursive()};
|
||||
if (inst.GetOpcode() == IR::Opcode::Identity) {
|
||||
value_inst->DestructiveAddUsage(inst.UseCount());
|
||||
value_inst->DestructiveRemoveUsage();
|
||||
}
|
||||
inst.SetDefinition(value_inst->Definition<Id>());
|
||||
IR::Inst& value_inst{RegAlloc::AliasInst(*value.Inst())};
|
||||
value_inst.DestructiveAddUsage(inst.UseCount());
|
||||
value_inst.DestructiveRemoveUsage();
|
||||
inst.SetDefinition(value_inst.Definition<Id>());
|
||||
}
|
||||
|
||||
void EmitIdentity(EmitContext&, IR::Inst& inst, const IR::Value& value) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue