From owner-svn-src-all@freebsd.org Sat Jul 4 20:07:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12C039373; Sat, 4 Jul 2015 20:07:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD44A1907; Sat, 4 Jul 2015 20:07:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t64K7cHv000377; Sat, 4 Jul 2015 20:07:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t64K7c9w000375; Sat, 4 Jul 2015 20:07:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201507042007.t64K7c9w000375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 4 Jul 2015 20:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285149 - in head/contrib/llvm/lib/Transforms: Scalar Utils X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 20:07:39 -0000 Author: dim Date: Sat Jul 4 20:07:37 2015 New Revision: 285149 URL: https://svnweb.freebsd.org/changeset/base/285149 Log: 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 Modified: head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp Modified: head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp Sat Jul 4 19:00:38 2015 (r285148) +++ head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp Sat Jul 4 20:07:37 2015 (r285149) @@ -1054,7 +1054,7 @@ void SCCPSolver::visitLoadInst(LoadInst // load null -> null if (isa(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(Ptr)) { Modified: head/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp Sat Jul 4 19:00:38 2015 (r285148) +++ head/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp Sat Jul 4 20:07:37 2015 (r285149) @@ -81,7 +81,7 @@ static void ConnectProlog(Loop *L, Value 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);