From: Duncan P. N. Exon Smith Date: Sat, 24 Sep 2016 02:30:11 +0000 (+0000) Subject: GlobalStatus: Don't walk use-lists of ConstantData X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c1ce9acb644de2cbc743b8756629b70419c34c8e;p=llvm 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 --- diff --git a/lib/Transforms/Utils/GlobalStatus.cpp b/lib/Transforms/Utils/GlobalStatus.cpp index 266be41fbea..a5ddee3c70c 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())