From c1ce9acb644de2cbc743b8756629b70419c34c8e Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sat, 24 Sep 2016 02:30:11 +0000 Subject: [PATCH] GlobalStatus: Don't walk use-lists of ConstantData Return early from llvm::isSafeToDestroyConstant() whenever the value `isa()`. These constants are shared across the LLVMContext. We never really want to delete them here, and walking their use-lists can be very expensive. (This is motivated by an eventual goal of removing use-lists entirely from ConstantData.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282320 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/GlobalStatus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Utils/GlobalStatus.cpp b/lib/Transforms/Utils/GlobalStatus.cpp index 266be41fbead..a5ddee3c70cb 100644 --- a/lib/Transforms/Utils/GlobalStatus.cpp +++ b/lib/Transforms/Utils/GlobalStatus.cpp @@ -35,7 +35,7 @@ bool llvm::isSafeToDestroyConstant(const Constant *C) { if (isa(C)) return false; - if (isa(C) || isa(C)) + if (isa(C)) return false; for (const User *U : C->users())