From b8ad3eebcad9417cab81418d302dfda4b910f5eb Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Tue, 11 Jul 2017 23:10:17 +0000 Subject: [IPO] Temporarily rollback r307215. [GlobalOpt] Remove unreachable blocks before optimizing a function. While the change is presumably correct, it exposes a latent bug in DI which breaks on of the CFI checks. I'll analyze it further and try to understand what's going on. llvm-svn: 307729 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 93eab680ca6..3d57acf06e7 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -2026,24 +2026,6 @@ OptimizeFunctions(Module &M, TargetLibraryInfo *TLI, continue; } - // LLVM's definition of dominance allows instructions that are cyclic - // in unreachable blocks, e.g.: - // %pat = select i1 %condition, @global, i16* %pat - // because any instruction dominates an instruction in a block that's - // not reachable from entry. - // So, remove unreachable blocks from the function, because a) there's - // no point in analyzing them and b) GlobalOpt should otherwise grow - // some more complicated logic to break these cycles. - // Removing unreachable blocks might invalidate the dominator so we - // recalculate it. - if (!F->isDeclaration()) { - if (removeUnreachableBlocks(*F)) { - auto &DT = LookupDomTree(*F); - DT.recalculate(*F); - Changed = true; - } - } - Changed |= processGlobal(*F, TLI, LookupDomTree); if (!F->hasLocalLinkage()) -- cgit v1.2.3