aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2019-02-04 05:04:19 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2019-02-04 05:04:19 +0000
commit437ee05885215339bfda865646b10c6a05626660 (patch)
treea1a51cdd1863988615d8f81c40d0904f01f19265 /llvm/lib/Analysis/ScalarEvolution.cpp
parentb5e945c260975c25c5ee423c081c98b78d959e0a (diff)
downloadllvm-437ee05885215339bfda865646b10c6a05626660.zip
llvm-437ee05885215339bfda865646b10c6a05626660.tar.gz
llvm-437ee05885215339bfda865646b10c6a05626660.tar.bz2
[SCEV] Do not bother creating separate SCEVUnknown for unreachable nodes
Currently, SCEV creates SCEVUnknown for every node of unreachable code. If we have a huge amounts of such code, we will be littering SE with these nodes. We could just state that they all are undef and save some memory. Differential Revision: https://reviews.llvm.org/D57567 Reviewed By: sanjoy llvm-svn: 353017
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index c554f9c..fcf6a2b 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -6144,7 +6144,7 @@ const SCEV *ScalarEvolution::createSCEV(Value *V) {
// to obey basic rules for definitions dominating uses which this
// analysis depends on.
if (!DT.isReachableFromEntry(I->getParent()))
- return getUnknown(V);
+ return getUnknown(UndefValue::get(V->getType()));
} else if (ConstantInt *CI = dyn_cast<ConstantInt>(V))
return getConstant(CI);
else if (isa<ConstantPointerNull>(V))