summaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/LICM.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-09-24 20:02:42 +0000
committerDevang Patel <dpatel@apple.com>2007-09-24 20:02:42 +0000
commit128459b85b59530e511ea17b3cc3a5b8ee3e8bd4 (patch)
tree2f0e73eb6e409f6b9ea41c76a1d3cc6615b6e5b7 /lib/Transforms/Scalar/LICM.cpp
parentd81ccc2806b2c8a498d16f1a547d0cc9c00d602d (diff)
downloadexternal_llvm-128459b85b59530e511ea17b3cc3a5b8ee3e8bd4.zip
external_llvm-128459b85b59530e511ea17b3cc3a5b8ee3e8bd4.tar.gz
external_llvm-128459b85b59530e511ea17b3cc3a5b8ee3e8bd4.tar.bz2
Do not promote null values because it may be unsafe to do so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LICM.cpp')
-rw-r--r--lib/Transforms/Scalar/LICM.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 3058f74..f112ba8 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -800,6 +800,10 @@ void LICM::FindPromotableValuesInLoop(
break;
}
+ // Do not promote null values because it may be unsafe to do so.
+ if (isa<ConstantPointerNull>(V))
+ PointerOk = false;
+
if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) {
// If GEP base is NULL then the calculated address used by Store or
// Load instruction is invalid. Do not promote this value because