backend/arm64/reg_alloc: Handle immediates in DefineAsExisting

This commit is contained in:
Merry 2022-07-24 21:01:43 +01:00 committed by merry
parent 277f7a76e9
commit a5f3164c38

View file

@ -177,6 +177,11 @@ void RegAlloc::PrepareForCall(IR::Inst* result, std::optional<Argument::copyable
}
void RegAlloc::DefineAsExisting(IR::Inst* inst, Argument& arg) {
if (arg.value.IsImmediate()) {
inst->ReplaceUsesWith(arg.value);
return;
}
ASSERT(!ValueLocation(inst));
auto& info = ValueInfo(arg.value.GetInst());
info.values.emplace_back(inst);