From b8cd66b5d78eaeba41ab372aaca5180dd54e4385 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Wed, 25 Jul 2012 21:19:40 +0000 Subject: [PATCH] It's not safe to blindly remove invoke instructions. This happens when we encounter an invoke of an allocation function. This should fix the dragonegg bootstrap. Testcase to follow, later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160757 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/GlobalOpt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 72623a36e50..6d950d20240 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -352,7 +352,8 @@ static bool IsSafeComputationToRemove(Value *V) { return true; if (!V->hasOneUse()) return false; - if (isa(V) || isa(V) || isa(V)) + if (isa(V) || isa(V) || isa(V) || + isa(V)) return false; if (isAllocationFn(V)) return true; -- 2.34.1