From fd09feaaa19c1ae3441dd687bced1b12ff7c768e Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Wed, 9 Apr 2025 16:24:17 -0500 Subject: void field rework (#6739) * void field rework * move void cleanup pass earlier --- source/slang/slang-ir-cleanup-void.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'source/slang/slang-ir-cleanup-void.cpp') diff --git a/source/slang/slang-ir-cleanup-void.cpp b/source/slang/slang-ir-cleanup-void.cpp index 84532d0ec..3a776fc4f 100644 --- a/source/slang/slang-ir-cleanup-void.cpp +++ b/source/slang/slang-ir-cleanup-void.cpp @@ -122,8 +122,6 @@ struct CleanUpVoidContext case kIROp_StructType: { List toRemove; - UInt fieldCount = 0; - ShortList voidFieldIndex; for (auto child : inst->getChildren()) { if (auto field = as(child)) @@ -131,33 +129,11 @@ struct CleanUpVoidContext if (field->getFieldType()->getOp() == kIROp_VoidType) { toRemove.add(field); - voidFieldIndex.add(fieldCount); } } - fieldCount++; } for (auto ii : toRemove) ii->removeAndDeallocate(); - - // Once we remove the void fields in the struct, we also need update the make_struct - // call sites to remove the arguments corresponding to the void fields. - if (inst->hasUses() && voidFieldIndex.getCount()) - { - UInt currentFieldCount = fieldCount - toRemove.getCount(); - for (auto use = inst->firstUse; use; use = use->nextUse) - { - if (auto makeStructInst = as(use->user)) - { - if (makeStructInst->getOperandCount() != currentFieldCount) - { - for (Int i = 0; i < voidFieldIndex.getCount(); i++) - { - makeStructInst->removeOperand(voidFieldIndex[i]); - } - } - } - } - } } break; default: -- cgit v1.2.3