From owner-svn-src-projects@freebsd.org Sat Dec 10 15:30:40 2016 Return-Path: Delivered-To: svn-src-projects@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 ABBEAC705BA for ; Sat, 10 Dec 2016 15:30:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7B0F81E00; Sat, 10 Dec 2016 15:30:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAFUd7l013529; Sat, 10 Dec 2016 15:30:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAFUdep013525; Sat, 10 Dec 2016 15:30:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612101530.uBAFUdep013525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 10 Dec 2016 15:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r309816 - in projects/clang391-import: contrib/llvm/lib/Target/AArch64 contrib/llvm/lib/Target/ARM lib/clang/include/clang/Basic X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 15:30:40 -0000 Author: dim Date: Sat Dec 10 15:30:39 2016 New Revision: 309816 URL: https://svnweb.freebsd.org/changeset/base/309816 Log: Update llvm, clang, lld, lldb, compiler-rt and libc++ to release_39 branch r288847. Modified: projects/clang391-import/contrib/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp projects/clang391-import/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp projects/clang391-import/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp projects/clang391-import/lib/clang/include/clang/Basic/Version.inc Directory Properties: projects/clang391-import/contrib/compiler-rt/ (props changed) projects/clang391-import/contrib/libc++/ (props changed) projects/clang391-import/contrib/llvm/ (props changed) projects/clang391-import/contrib/llvm/tools/clang/ (props changed) projects/clang391-import/contrib/llvm/tools/lld/ (props changed) projects/clang391-import/contrib/llvm/tools/lldb/ (props changed) Modified: projects/clang391-import/contrib/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp ============================================================================== --- projects/clang391-import/contrib/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp Sat Dec 10 15:02:23 2016 (r309815) +++ projects/clang391-import/contrib/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp Sat Dec 10 15:30:39 2016 (r309816) @@ -718,13 +718,21 @@ bool AArch64ExpandPseudo::expandCMP_SWAP .addReg(DestLo.getReg(), getKillRegState(DestLo.isDead())) .addOperand(DesiredLo) .addImm(0); - BuildMI(LoadCmpBB, DL, TII->get(AArch64::SBCSXr), AArch64::XZR) + BuildMI(LoadCmpBB, DL, TII->get(AArch64::CSINCWr), StatusReg) + .addReg(AArch64::WZR) + .addReg(AArch64::WZR) + .addImm(AArch64CC::EQ); + BuildMI(LoadCmpBB, DL, TII->get(AArch64::SUBSXrs), AArch64::XZR) .addReg(DestHi.getReg(), getKillRegState(DestHi.isDead())) - .addOperand(DesiredHi); - BuildMI(LoadCmpBB, DL, TII->get(AArch64::Bcc)) - .addImm(AArch64CC::NE) - .addMBB(DoneBB) - .addReg(AArch64::NZCV, RegState::Implicit | RegState::Kill); + .addOperand(DesiredHi) + .addImm(0); + BuildMI(LoadCmpBB, DL, TII->get(AArch64::CSINCWr), StatusReg) + .addReg(StatusReg, RegState::Kill) + .addReg(StatusReg, RegState::Kill) + .addImm(AArch64CC::EQ); + BuildMI(LoadCmpBB, DL, TII->get(AArch64::CBNZW)) + .addReg(StatusReg, RegState::Kill) + .addMBB(DoneBB); LoadCmpBB->addSuccessor(DoneBB); LoadCmpBB->addSuccessor(StoreBB); Modified: projects/clang391-import/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp ============================================================================== --- projects/clang391-import/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Sat Dec 10 15:02:23 2016 (r309815) +++ projects/clang391-import/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Sat Dec 10 15:30:39 2016 (r309816) @@ -10083,17 +10083,24 @@ static void ReplaceReductionResults(SDNo Results.push_back(SplitVal); } +static std::pair splitInt128(SDValue N, SelectionDAG &DAG) { + SDLoc DL(N); + SDValue Lo = DAG.getNode(ISD::TRUNCATE, DL, MVT::i64, N); + SDValue Hi = DAG.getNode(ISD::TRUNCATE, DL, MVT::i64, + DAG.getNode(ISD::SRL, DL, MVT::i128, N, + DAG.getConstant(64, DL, MVT::i64))); + return std::make_pair(Lo, Hi); +} + static void ReplaceCMP_SWAP_128Results(SDNode *N, SmallVectorImpl & Results, SelectionDAG &DAG) { assert(N->getValueType(0) == MVT::i128 && "AtomicCmpSwap on types less than 128 should be legal"); - SDValue Ops[] = {N->getOperand(1), - N->getOperand(2)->getOperand(0), - N->getOperand(2)->getOperand(1), - N->getOperand(3)->getOperand(0), - N->getOperand(3)->getOperand(1), - N->getOperand(0)}; + auto Desired = splitInt128(N->getOperand(2), DAG); + auto New = splitInt128(N->getOperand(3), DAG); + SDValue Ops[] = {N->getOperand(1), Desired.first, Desired.second, + New.first, New.second, N->getOperand(0)}; SDNode *CmpSwap = DAG.getMachineNode( AArch64::CMP_SWAP_128, SDLoc(N), DAG.getVTList(MVT::i64, MVT::i64, MVT::i32, MVT::Other), Ops); Modified: projects/clang391-import/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp ============================================================================== --- projects/clang391-import/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp Sat Dec 10 15:02:23 2016 (r309815) +++ projects/clang391-import/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp Sat Dec 10 15:30:39 2016 (r309816) @@ -932,13 +932,10 @@ bool ARMExpandPseudo::ExpandCMP_SWAP_64( .addReg(DestLo, getKillRegState(Dest.isDead())) .addReg(DesiredLo, getKillRegState(Desired.isDead()))); - unsigned SBCrr = IsThumb ? ARM::t2SBCrr : ARM::SBCrr; - MIB = BuildMI(LoadCmpBB, DL, TII->get(SBCrr)) - .addReg(StatusReg, RegState::Define | RegState::Dead) - .addReg(DestHi, getKillRegState(Dest.isDead())) - .addReg(DesiredHi, getKillRegState(Desired.isDead())); - AddDefaultPred(MIB); - MIB.addReg(ARM::CPSR, RegState::Kill); + BuildMI(LoadCmpBB, DL, TII->get(CMPrr)) + .addReg(DestHi, getKillRegState(Dest.isDead())) + .addReg(DesiredHi, getKillRegState(Desired.isDead())) + .addImm(ARMCC::EQ).addReg(ARM::CPSR, RegState::Kill); unsigned Bcc = IsThumb ? ARM::tBcc : ARM::Bcc; BuildMI(LoadCmpBB, DL, TII->get(Bcc)) Modified: projects/clang391-import/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- projects/clang391-import/lib/clang/include/clang/Basic/Version.inc Sat Dec 10 15:02:23 2016 (r309815) +++ projects/clang391-import/lib/clang/include/clang/Basic/Version.inc Sat Dec 10 15:30:39 2016 (r309816) @@ -7,4 +7,4 @@ #define CLANG_VENDOR "FreeBSD " -#define SVN_REVISION "288513" +#define SVN_REVISION "288847"