gpu: unimplemented semantic is not critical error

This commit is contained in:
DH 2024-11-14 19:47:35 +03:00
parent 89d04a3d10
commit 76cf146a32

View File

@ -1617,9 +1617,42 @@ static void instructionsToSpv(GcnConverter &converter, gcn::Import &importer,
auto function = semanticModuleInfo.findSemanticOf(inst.getInstId());
if (function == nullptr) {
std::println(std::cerr, "unimplemented semantic: ");
inst.print(std::cerr, context.ns);
std::cerr << "\n";
rx::die("unimplemented semantic");
std::println(std::cerr);
std::vector<ir::Instruction> workList;
std::set<ir::Instruction> removed;
workList.push_back(inst);
while (!workList.empty()) {
auto inst = workList.back();
workList.pop_back();
if (!removed.insert(inst).second) {
continue;
}
std::println(std::cerr, "removing ");
inst.print(std::cerr, context.ns);
std::println(std::cerr);
if (auto value = inst.cast<ir::Value>()) {
for (auto &use : value.getUseList()) {
if (removed.contains(use.user)) {
continue;
}
workList.push_back(use.user);
}
value.replaceAllUsesWith(builder.createSpvUndef(
inst.getLocation(), value.getOperand(0).getAsValue()));
}
inst.remove();
}
continue;
}
function = ir::clone(function, context, importer);