Ignore NonSemanticInstructions (#5171)

Fix #5163.

Ignore NonSemanticInstructions in DoDeadOutputStoresElimination and
ComputeLiveness.
This commit is contained in:
Jeremy Hayes 2023-03-24 10:46:52 -06:00 committed by GitHub
parent 32a4d840bb
commit b4e0850ef7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -219,7 +219,7 @@ Pass::Status EliminateDeadOutputStoresPass::DoDeadOutputStoreElimination() {
var_id, [this, &var, is_builtin](Instruction* user) { var_id, [this, &var, is_builtin](Instruction* user) {
auto op = user->opcode(); auto op = user->opcode();
if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName || if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName ||
op == spv::Op::OpDecorate) op == spv::Op::OpDecorate || user->IsNonSemanticInstruction())
return; return;
if (is_builtin) if (is_builtin)
KillAllDeadStoresOfBuiltinRef(user, &var); KillAllDeadStoresOfBuiltinRef(user, &var);

View File

@ -309,7 +309,7 @@ void LivenessManager::ComputeLiveness() {
def_use_mgr->ForEachUser(var_id, [this, &var](Instruction* user) { def_use_mgr->ForEachUser(var_id, [this, &var](Instruction* user) {
auto op = user->opcode(); auto op = user->opcode();
if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName || if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName ||
op == spv::Op::OpDecorate) { op == spv::Op::OpDecorate || user->IsNonSemanticInstruction()) {
return; return;
} }
MarkRefLive(user, &var); MarkRefLive(user, &var);