summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-07-01 05:37:57 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-07-01 05:37:57 +0000
commit9402e27ae0b29498cdbeb03860adfad5750c0005 (patch)
tree06ddd63cba47328eb4764c91ffa3f4fdb94ec619 /llvm/lib/Transforms
parent879d42099927c3d044e88cc672f34ee4ab4b7657 (diff)
downloadbcm5719-llvm-9402e27ae0b29498cdbeb03860adfad5750c0005.tar.gz
bcm5719-llvm-9402e27ae0b29498cdbeb03860adfad5750c0005.zip
[SCCP] Turn loads of null into undef instead of zero initialized values
Surprisingly, this is a correctness issue: the mmx type exists for calling convention purposes, LLVM doesn't have a zero representation for them. This partially fixes PR23999. llvm-svn: 241142
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index bc068f78c57..305175ff8f7 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -1055,7 +1055,7 @@ void SCCPSolver::visitLoadInst(LoadInst &I) {
// load null -> null
if (isa<ConstantPointerNull>(Ptr) && I.getPointerAddressSpace() == 0)
- return markConstant(IV, &I, Constant::getNullValue(I.getType()));
+ return markConstant(IV, &I, UndefValue::get(I.getType()));
// Transform load (constant global) into the value loaded.
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Ptr)) {
OpenPOWER on IntegriCloud