From owner-svn-src-stable@FreeBSD.ORG Mon Nov 25 22:56:46 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 901E4EA3; Mon, 25 Nov 2013 22:56:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F19E2045; Mon, 25 Nov 2013 22:56:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAPMukbR074056; Mon, 25 Nov 2013 22:56:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAPMukkv074055; Mon, 25 Nov 2013 22:56:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201311252256.rAPMukkv074055@svn.freebsd.org> From: Dimitry Andric Date: Mon, 25 Nov 2013 22:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258607 - stable/10/contrib/llvm/lib/Analysis X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2013 22:56:46 -0000 Author: dim Date: Mon Nov 25 22:56:46 2013 New Revision: 258607 URL: http://svnweb.freebsd.org/changeset/base/258607 Log: MFC r258350: Pull in r191896 from upstream llvm trunk: CaptureTracking: Plug a loophole in the "too many uses" heuristic. The heuristic was added to avoid spending too much compile time in a specially crafted test case (PR17461, PR16474) with many uses on a select or bitcast instruction can still trigger the slow case. Add a check for that case. This only affects compile time, don't have a good way to test it. This fixes the excessive compile time spent on a specific file of the graphics/rawtherapee port. Reported by: mandree Approved by: re (gjb) Modified: stable/10/contrib/llvm/lib/Analysis/CaptureTracking.cpp Directory Properties: stable/10/contrib/llvm/ (props changed) Modified: stable/10/contrib/llvm/lib/Analysis/CaptureTracking.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Analysis/CaptureTracking.cpp Mon Nov 25 22:55:47 2013 (r258606) +++ stable/10/contrib/llvm/lib/Analysis/CaptureTracking.cpp Mon Nov 25 22:56:46 2013 (r258607) @@ -146,8 +146,14 @@ void llvm::PointerMayBeCaptured(const Va case Instruction::PHI: case Instruction::Select: // The original value is not captured via this if the new value isn't. + Count = 0; for (Instruction::use_iterator UI = I->use_begin(), UE = I->use_end(); UI != UE; ++UI) { + // If there are lots of uses, conservatively say that the value + // is captured to avoid taking too much compile time. + if (Count++ >= Threshold) + return Tracker->tooManyUses(); + Use *U = &UI.getUse(); if (Visited.insert(U)) if (Tracker->shouldExplore(U))