From owner-svn-src-all@FreeBSD.ORG Sun Feb 8 08:24:25 2015 Return-Path: <owner-svn-src-all@FreeBSD.ORG> Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46C80FBF; Sun, 8 Feb 2015 08:24:25 +0000 (UTC) Received: from vlakno.cz (mail.vlakno.cz [91.217.96.224]) by mx1.freebsd.org (Postfix) with ESMTP id BFD0DAF9; Sun, 8 Feb 2015 08:24:23 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 61DEC1D95B5A; Sun, 8 Feb 2015 09:23:37 +0100 (CET) Date: Sun, 8 Feb 2015 09:23:37 +0100 From: Roman Divacky <rdivacky@freebsd.org> To: Dimitry Andric <dim@FreeBSD.org> Subject: Re: svn commit: r278361 - in head/contrib/llvm: lib/Target/X86 patches Message-ID: <20150208082337.GA81836@vlakno.cz> References: <201502071657.t17GvXW9092528@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502071657.t17GvXW9092528@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" <svn-src-all.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>, <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/> List-Post: <mailto:svn-src-all@freebsd.org> List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>, <mailto:svn-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 08 Feb 2015 08:24:25 -0000 Fwiw, FastISel is only used for -O0, maybe the right way to "fix" the breakage is to not use -O0 ? On Sat, Feb 07, 2015 at 04:57:33PM +0000, Dimitry Andric wrote: > Author: dim > Date: Sat Feb 7 16:57:32 2015 > New Revision: 278361 > URL: https://svnweb.freebsd.org/changeset/base/278361 > > Log: > Back out r278349 and r278350 for now, since this apparently blows up the > kernel build in sys/dev/hptmv/hptproc.c for some people. > > Reported by: sbruno, Matthew Fuller <fullermd@over-yonder.net> > > Deleted: > head/contrib/llvm/patches/patch-32-llvm-r224884-invalid-reg-replacement.diff > Modified: > head/contrib/llvm/lib/Target/X86/X86FastISel.cpp > > Modified: head/contrib/llvm/lib/Target/X86/X86FastISel.cpp > ============================================================================== > --- head/contrib/llvm/lib/Target/X86/X86FastISel.cpp Sat Feb 7 14:31:51 2015 (r278360) > +++ head/contrib/llvm/lib/Target/X86/X86FastISel.cpp Sat Feb 7 16:57:32 2015 (r278361) > @@ -2699,9 +2699,6 @@ bool X86FastISel::FastLowerCall(CallLowe > TM.Options.GuaranteedTailCallOpt)) > return false; > > - SmallVector<MVT, 16> OutVTs; > - SmallVector<unsigned, 16> ArgRegs; > - > // If this is a constant i1/i8/i16 argument, promote to i32 to avoid an extra > // instruction. This is safe because it is common to all FastISel supported > // calling conventions on x86. > @@ -2719,34 +2716,28 @@ bool X86FastISel::FastLowerCall(CallLowe > > // Passing bools around ends up doing a trunc to i1 and passing it. > // Codegen this as an argument + "and 1". > - MVT VT; > - auto *TI = dyn_cast<TruncInst>(Val); > - unsigned ResultReg; > - if (TI && TI->getType()->isIntegerTy(1) && CLI.CS && > - (TI->getParent() == CLI.CS->getInstruction()->getParent()) && > - TI->hasOneUse()) { > - Value *PrevVal = TI->getOperand(0); > - ResultReg = getRegForValue(PrevVal); > - > - if (!ResultReg) > - return false; > + if (auto *TI = dyn_cast<TruncInst>(Val)) { > + if (TI->getType()->isIntegerTy(1) && CLI.CS && > + (TI->getParent() == CLI.CS->getInstruction()->getParent()) && > + TI->hasOneUse()) { > + Val = cast<TruncInst>(Val)->getOperand(0); > + unsigned ResultReg = getRegForValue(Val); > > - if (!isTypeLegal(PrevVal->getType(), VT)) > - return false; > + if (!ResultReg) > + return false; > > - ResultReg = > - FastEmit_ri(VT, VT, ISD::AND, ResultReg, hasTrivialKill(PrevVal), 1); > + MVT ArgVT; > + if (!isTypeLegal(Val->getType(), ArgVT)) > + return false; > > - if (!ResultReg) > - return false; > - } else { > - if (!isTypeLegal(Val->getType(), VT)) > - return false; > - ResultReg = getRegForValue(Val); > - } > + ResultReg = > + FastEmit_ri(ArgVT, ArgVT, ISD::AND, ResultReg, Val->hasOneUse(), 1); > > - ArgRegs.push_back(ResultReg); > - OutVTs.push_back(VT); > + if (!ResultReg) > + return false; > + UpdateValueMap(Val, ResultReg); > + } > + } > } > > // Analyze operands of the call, assigning locations to each operand. > @@ -2758,6 +2749,13 @@ bool X86FastISel::FastLowerCall(CallLowe > if (IsWin64) > CCInfo.AllocateStack(32, 8); > > + SmallVector<MVT, 16> OutVTs; > + for (auto *Val : OutVals) { > + MVT VT; > + if (!isTypeLegal(Val->getType(), VT)) > + return false; > + OutVTs.push_back(VT); > + } > CCInfo.AnalyzeCallOperands(OutVTs, OutFlags, CC_X86); > > // Get a count of how many bytes are to be pushed on the stack. > @@ -2779,7 +2777,9 @@ bool X86FastISel::FastLowerCall(CallLowe > if (ArgVT == MVT::x86mmx) > return false; > > - unsigned ArgReg = ArgRegs[VA.getValNo()]; > + unsigned ArgReg = getRegForValue(ArgVal); > + if (!ArgReg) > + return false; > > // Promote the value if needed. > switch (VA.getLocInfo()) {