[CPU] Disable context promotion only for vertex type

This commit is contained in:
Gliniak
2026-01-25 20:30:48 +01:00
committed by Radosław Gliński
parent 67d80958c9
commit a74fe21f76

View File

@@ -105,7 +105,7 @@ void ContextPromotionPass::PromoteBlock(Block* block) {
// Volatile instruction - requires all context values be flushed. // Volatile instruction - requires all context values be flushed.
validity.reset(); validity.reset();
} else if (i->opcode == &OPCODE_LOAD_CONTEXT_info) { } else if (i->opcode == &OPCODE_LOAD_CONTEXT_info) {
size_t offset = i->src1.offset; const size_t offset = i->src1.offset;
if (validity.test(static_cast<uint32_t>(offset))) { if (validity.test(static_cast<uint32_t>(offset))) {
// Legit previous value, reuse. // Legit previous value, reuse.
Value* previous_value = context_values_[offset]; Value* previous_value = context_values_[offset];
@@ -113,16 +113,20 @@ void ContextPromotionPass::PromoteBlock(Block* block) {
i->set_src1(previous_value); i->set_src1(previous_value);
} else { } else {
// Store the loaded value into the table. // Store the loaded value into the table.
if (i->dest->type != TypeName::VEC128_TYPE) {
context_values_[offset] = i->dest; context_values_[offset] = i->dest;
validity.set(static_cast<uint32_t>(offset)); validity.set(static_cast<uint32_t>(offset));
} }
}
} else if (i->opcode == &OPCODE_STORE_CONTEXT_info) { } else if (i->opcode == &OPCODE_STORE_CONTEXT_info) {
size_t offset = i->src1.offset; const size_t offset = i->src1.offset;
Value* value = i->src2.value; Value* value = i->src2.value;
if (value->type != TypeName::VEC128_TYPE) {
// Store value into the table for later. // Store value into the table for later.
context_values_[offset] = value; context_values_[offset] = value;
validity.set(static_cast<uint32_t>(offset)); validity.set(static_cast<uint32_t>(offset));
} }
}
i = next; i = next;
} }
} }
@@ -140,7 +144,9 @@ void ContextPromotionPass::RemoveDeadStoresBlock(Block* block) {
// Volatile instruction - requires all context values be flushed. // Volatile instruction - requires all context values be flushed.
validity.reset(); validity.reset();
} else if (i->opcode == &OPCODE_STORE_CONTEXT_info) { } else if (i->opcode == &OPCODE_STORE_CONTEXT_info) {
size_t offset = i->src1.offset; const size_t offset = i->src1.offset;
const Value* value = i->src2.value;
if (value->type != TypeName::VEC128_TYPE) {
if (!validity.test(static_cast<uint32_t>(offset))) { if (!validity.test(static_cast<uint32_t>(offset))) {
// Offset not yet written, mark and continue. // Offset not yet written, mark and continue.
validity.set(static_cast<uint32_t>(offset)); validity.set(static_cast<uint32_t>(offset));
@@ -149,6 +155,7 @@ void ContextPromotionPass::RemoveDeadStoresBlock(Block* block) {
i->UnlinkAndNOP(); i->UnlinkAndNOP();
} }
} }
}
i = prev; i = prev;
} }
} }