diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-09-24 02:30:11 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-09-24 02:30:11 +0000 |
commit | c82c11428e0ab2ff58a342ca3a615315929a2633 (patch) | |
tree | a18b5d30fcbf08ade38d7fd0cfaa25cc2fd2e691 /llvm/lib/Transforms | |
parent | afad84c04b4a6a7ec2d5ac56cf9022e488f875bb (diff) | |
download | bcm5719-llvm-c82c11428e0ab2ff58a342ca3a615315929a2633.tar.gz bcm5719-llvm-c82c11428e0ab2ff58a342ca3a615315929a2633.zip |
GlobalStatus: Don't walk use-lists of ConstantData
Return early from llvm::isSafeToDestroyConstant() whenever the value
`isa<ConstantData>()`. 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.)
llvm-svn: 282320
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Utils/GlobalStatus.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/GlobalStatus.cpp b/llvm/lib/Transforms/Utils/GlobalStatus.cpp index 266be41fbea..a5ddee3c70c 100644 --- a/llvm/lib/Transforms/Utils/GlobalStatus.cpp +++ b/llvm/lib/Transforms/Utils/GlobalStatus.cpp @@ -35,7 +35,7 @@ bool llvm::isSafeToDestroyConstant(const Constant *C) { if (isa<GlobalValue>(C)) return false; - if (isa<ConstantInt>(C) || isa<ConstantFP>(C)) + if (isa<ConstantData>(C)) return false; for (const User *U : C->users()) |