aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-07-04 20:07:37 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-07-04 20:07:37 +0000
commit5f4899dbfe37eba1c460b27b761bd457cfadd508 (patch)
tree50c7c065ddffab8c583f7260f5862102ead7f5fb /contrib/llvm/lib/Transforms
parent0936003e3d798c72d758b990aa6575e59dca4c54 (diff)
downloadsrc-5f4899dbfe37eba1c460b27b761bd457cfadd508.tar.gz
src-5f4899dbfe37eba1c460b27b761bd457cfadd508.zip
Pull in r241142 from upstream llvm trunk (by David Majnemer):
[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. Pull in r241143 from upstream llvm trunk (by David Majnemer): [LoopUnroll] Use undef for phis with no value live We would create a phi node with a zero initialized operand instead of undef in the case where no value was originally available. This was problematic for x86_mmx which has no null value. These fix a "Cannot create a null constant of that type!" error when compiling the graphics/sdl2_gfx port with MMX enabled. Reported by: amdmi3
Notes
Notes: svn path=/head/; revision=285149
Diffstat (limited to 'contrib/llvm/lib/Transforms')
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/SCCP.cpp2
-rw-r--r--contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp b/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp
index cfc9a8e89fa0..e0e314a4328b 100644
--- a/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -1054,7 +1054,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)) {
diff --git a/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
index 8a32215a299f..db4a5c1e5b78 100644
--- a/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
@@ -81,7 +81,7 @@ static void ConnectProlog(Loop *L, Value *BECount, unsigned Count,
if (L->contains(PN)) {
NewPN->addIncoming(PN->getIncomingValueForBlock(NewPH), OrigPH);
} else {
- NewPN->addIncoming(Constant::getNullValue(PN->getType()), OrigPH);
+ NewPN->addIncoming(UndefValue::get(PN->getType()), OrigPH);
}
Value *V = PN->getIncomingValueForBlock(Latch);