fix BitCastCombinePass
Some checks failed
Build and Test with Bazel / build (macos-latest) (push) Has been cancelled
Build and Test with Bazel / build (ubuntu-latest) (push) Has been cancelled
Build and Test with Bazel / build (windows-2019) (push) Has been cancelled
iOS / build (macos-12) (push) Has been cancelled
iOS / build (macos-13) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Wasm Build / build (push) Has been cancelled

fix diag message
This commit is contained in:
DH 2024-09-25 19:01:09 +03:00
parent 7ad631f1bf
commit dafc684588
2 changed files with 9 additions and 5 deletions

View File

@ -34,9 +34,13 @@ bool BitCastCombinePass::SimplifyBitcast() {
assert(valueId != 0);
auto value = context()->get_def_use_mgr()->GetDef(valueId);
inst->RemoveOperand(2);
inst->InsertOperand(2, Operand(value->GetOperand(2)));
modified = true;
if (value->opcode() == spv::Op::OpBitcast) {
// bitcast(X, bitcast(Y, A)) -> bitcast(X, A)
// inst->Dump();
inst->RemoveOperand(2);
inst->InsertOperand(2, Operand(value->GetOperand(2)));
modified = true;
}
});
return modified;

View File

@ -796,9 +796,9 @@ spv_result_t StructuredControlFlowChecks(
for (auto pred : *block->predecessors()) {
if (pred->structurally_reachable() && !construct_blocks.count(pred)) {
return _.diag(SPV_ERROR_INVALID_CFG, _.FindDef(pred->id()))
<< "block <ID> " << pred->id() << " branches to the "
<< "block <ID> " << _.getIdName(pred->id()) << " branches to the "
<< construct_name << " construct, but not to the "
<< header_name << " <ID> " << header->id();
<< header_name << " <ID> " << _.getIdName(header->id());
}
}