From 1771d81475e335d36cea22032aed2dbee0dee077 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 23 Jan 2023 19:40:17 -0800 Subject: [PATCH] [Attributor] Allow to delete (assume) intrinsics outside the SCC --- llvm/lib/Transforms/IPO/Attributor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index ee70a39..b9134ce 100644 --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -2354,7 +2354,7 @@ ChangeStatus Attributor::cleanupIR() { for (const auto &V : ToBeDeletedInsts) { if (Instruction *I = dyn_cast_or_null(V)) { if (auto *CB = dyn_cast(I)) { - assert(isRunOn(*I->getFunction()) && + assert((isa(CB) || isRunOn(*I->getFunction())) && "Cannot delete an instruction outside the current SCC!"); if (!isa(CB)) Configuration.CGUpdater.removeCallSite(*CB); -- 2.7.4