Skip to content

Commit 2ac3a0b

Browse files
mateuszchudykigcbot
authored andcommitted
Remove old functions at the very end of PromoteBools pass.
Remove old functions at the very end of PromoteBools pass.
1 parent 8d6d587 commit 2ac3a0b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

IGC/AdaptorOCL/preprocess_spvir/PromoteBools.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,6 @@ void PromoteBools::cleanUp(Module& module)
250250
{
251251
renameAndClean(globalVariable, it.second);
252252
}
253-
else if (auto function = dyn_cast<Function>(it.first))
254-
{
255-
renameAndClean(function, it.second);
256-
}
257253
else if (auto alloca = dyn_cast<AllocaInst>(it.first))
258254
{
259255
renameAndClean(alloca, it.second);
@@ -291,6 +287,15 @@ void PromoteBools::cleanUp(Module& module)
291287
{
292288
trunc->eraseFromParent();
293289
}
290+
291+
// Remove old version of functions
292+
for (auto& it : promotedValuesCache)
293+
{
294+
if (auto function = dyn_cast<Function>(it.first))
295+
{
296+
renameAndClean(function, it.second);
297+
}
298+
}
294299
}
295300

296301
Type* PromoteBools::getOrCreatePromotedType(Type* type)

0 commit comments

Comments
 (0)