summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/common.gypi17
-rw-r--r--build/config/compiler/BUILD.gn3
-rw-r--r--build/sanitizers/sanitizer_options.cc2
-rw-r--r--chrome/installer/linux/debian/expected_deps_x641
-rw-r--r--chrome/installer/linux/rpm/expected_deps_i3861
-rw-r--r--chrome/installer/linux/rpm/expected_deps_x86_642
-rw-r--r--tools/clang/blink_gc_plugin/CMakeLists.txt2
-rw-r--r--tools/clang/plugins/tests/overridden_methods.txt24
-rwxr-xr-xtools/clang/plugins/tests/test.sh1
-rwxr-xr-xtools/clang/scripts/package.sh2
-rwxr-xr-xtools/clang/scripts/repackage.sh2
-rwxr-xr-xtools/clang/scripts/update.sh289
12 files changed, 187 insertions, 159 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 26fef93..c899e14 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -2521,9 +2521,6 @@
# code generated by flex (used in angle) contains that keyword.
# http://crbug.com/255186
'-Wno-deprecated-register',
-
- # TODO(hans): Get this cleaned up.
- '-Wno-inconsistent-missing-override',
],
},
'includes': [ 'set_clang_warning_flags.gypi', ],
@@ -4238,7 +4235,7 @@
'target_conditions': [
['_toolset=="target"', {
'cflags': [
- '-fsanitize-coverage=<(asan_coverage)',
+ '-mllvm -asan-coverage=<(asan_coverage)',
],
}],
],
@@ -4609,6 +4606,16 @@
# TODO(eugenis): find a way to reenable this.
'-mllvm -asan-globals=0',
],
+ 'conditions': [
+ ['target_arch=="arm"', {
+ 'ldflags': [
+ # TODO(hans): The ASan runtime is no longer automatically
+ # added to the link line when using -nostdlib. Can we
+ # stop adding -nostdlib? (crbug.com/423429)
+ '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/lib/clang/3.6.0/lib/linux/libclang_rt.asan-arm-android.so',
+ ],
+ }],
+ ],
}],
['android_webview_build==0', {
'defines': [
@@ -4901,7 +4908,7 @@
'target_conditions': [
['_toolset=="target"', {
'cflags': [
- '-fsanitize-coverage=<(asan_coverage)',
+ '-mllvm -asan-coverage=<(asan_coverage)',
],
}],
],
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index c221ddd..81269d6 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -762,9 +762,6 @@ config("default_warnings") {
# TODO(thakis): Remove, http://crbug.com/263960
"-Wno-reserved-user-defined-literal",
-
- # TODO(hans): Get this cleaned up.
- "-Wno-inconsistent-missing-override",
]
}
if (gcc_version >= 48) {
diff --git a/build/sanitizers/sanitizer_options.cc b/build/sanitizers/sanitizer_options.cc
index af78bf8..614a4a6 100644
--- a/build/sanitizers/sanitizer_options.cc
+++ b/build/sanitizers/sanitizer_options.cc
@@ -72,7 +72,7 @@ const char *kAsanDefaultOptions =
const char *kAsanDefaultOptions =
"strict_memcmp=0 replace_intrin=0 check_printf=1 use_sigaltstack=1 "
"strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 "
- "detect_stack_use_after_return=1 detect_odr_violation=0 ";
+ "detect_stack_use_after_return=1 ";
static const char kNaClDefaultOptions[] = "handle_segv=0";
static const char kNaClFlag[] = "--type=nacl-loader";
#endif // OS_LINUX
diff --git a/chrome/installer/linux/debian/expected_deps_x64 b/chrome/installer/linux/debian/expected_deps_x64
index 4025cfc..016b8ca 100644
--- a/chrome/installer/linux/debian/expected_deps_x64
+++ b/chrome/installer/linux/debian/expected_deps_x64
@@ -7,7 +7,6 @@ libdbus-1-3 (>= 1.2.14)
libexpat1 (>= 1.95.8)
libfontconfig1 (>= 2.8.0)
libfreetype6 (>= 2.3.9)
-libgcc1 (>= 1:4.1.1)
libgconf-2-4 (>= 2.31.1)
libgdk-pixbuf2.0-0 (>= 2.22.0)
libglib2.0-0 (>= 2.28.0)
diff --git a/chrome/installer/linux/rpm/expected_deps_i386 b/chrome/installer/linux/rpm/expected_deps_i386
index 5ba3362..1386b84 100644
--- a/chrome/installer/linux/rpm/expected_deps_i386
+++ b/chrome/installer/linux/rpm/expected_deps_i386
@@ -26,7 +26,6 @@ libfontconfig.so.1
libfreetype.so.6
libgcc_s.so.1
libgcc_s.so.1(GCC_3.0)
-libgcc_s.so.1(GCC_4.0.0)
libgcc_s.so.1(GLIBC_2.0)
libgconf-2.so.4
libgdk_pixbuf-2.0.so.0
diff --git a/chrome/installer/linux/rpm/expected_deps_x86_64 b/chrome/installer/linux/rpm/expected_deps_x86_64
index f838cb2..765596a 100644
--- a/chrome/installer/linux/rpm/expected_deps_x86_64
+++ b/chrome/installer/linux/rpm/expected_deps_x86_64
@@ -19,8 +19,6 @@ libdl.so.2(GLIBC_2.2.5)(64bit)
libexpat.so.1()(64bit)
libfontconfig.so.1()(64bit)
libfreetype.so.6()(64bit)
-libgcc_s.so.1()(64bit)
-libgcc_s.so.1(GCC_4.0.0)(64bit)
libgconf-2.so.4()(64bit)
libgdk_pixbuf-2.0.so.0()(64bit)
libgdk-x11-2.0.so.0()(64bit)
diff --git a/tools/clang/blink_gc_plugin/CMakeLists.txt b/tools/clang/blink_gc_plugin/CMakeLists.txt
index c511edf..85ce4a9 100644
--- a/tools/clang/blink_gc_plugin/CMakeLists.txt
+++ b/tools/clang/blink_gc_plugin/CMakeLists.txt
@@ -1,6 +1,6 @@
# This line is read by update.sh and other scripts in tools/clang/scripts
# Note: The spaces are significant.
-set(LIBRARYNAME BlinkGCPlugin_14)
+set(LIBRARYNAME BlinkGCPlugin_12)
add_llvm_loadable_module("lib${LIBRARYNAME}"
BlinkGCPlugin.cpp
diff --git a/tools/clang/plugins/tests/overridden_methods.txt b/tools/clang/plugins/tests/overridden_methods.txt
index 3ee0333..199876b 100644
--- a/tools/clang/plugins/tests/overridden_methods.txt
+++ b/tools/clang/plugins/tests/overridden_methods.txt
@@ -11,14 +11,14 @@ In file included from overridden_methods.cpp:5:
virtual void SomeConstMethod() const {}
^
override
-./overridden_methods.h:58:55: warning: [chromium-style] Overriding method must be marked with 'override' or 'final'.
+./overridden_methods.h:58:53: warning: [chromium-style] Overriding method must be marked with 'override' or 'final'.
virtual void SomeMethodWithExceptionSpec() throw() {}
- ^
- override
-./overridden_methods.h:61:69: warning: [chromium-style] Overriding method must be marked with 'override' or 'final'.
+ ^
+ override
+./overridden_methods.h:61:67: warning: [chromium-style] Overriding method must be marked with 'override' or 'final'.
virtual void SomeConstMethodWithExceptionSpec() const throw(int) {}
- ^
- override
+ ^
+ override
./overridden_methods.h:63:39: warning: [chromium-style] Overriding method must be marked with 'override' or 'final'.
virtual void SomeNonPureBaseMethod() {}
^
@@ -43,14 +43,14 @@ overridden_methods.cpp:32:39: warning: [chromium-style] Overriding method must b
virtual void SomeConstMethod() const {}
^
override
-overridden_methods.cpp:34:55: warning: [chromium-style] Overriding method must be marked with 'override' or 'final'.
+overridden_methods.cpp:34:53: warning: [chromium-style] Overriding method must be marked with 'override' or 'final'.
virtual void SomeMethodWithExceptionSpec() throw() {}
- ^
- override
-overridden_methods.cpp:37:69: warning: [chromium-style] Overriding method must be marked with 'override' or 'final'.
+ ^
+ override
+overridden_methods.cpp:37:67: warning: [chromium-style] Overriding method must be marked with 'override' or 'final'.
virtual void SomeConstMethodWithExceptionSpec() const throw(int) {}
- ^
- override
+ ^
+ override
overridden_methods.cpp:39:39: warning: [chromium-style] Overriding method must be marked with 'override' or 'final'.
virtual void SomeNonPureBaseMethod() {}
^
diff --git a/tools/clang/plugins/tests/test.sh b/tools/clang/plugins/tests/test.sh
index 63aa872..9f63f7a 100755
--- a/tools/clang/plugins/tests/test.sh
+++ b/tools/clang/plugins/tests/test.sh
@@ -34,7 +34,6 @@ do_testcase() {
fi
local output="$("${CLANG_PATH}" -fsyntax-only -Wno-c++11-extensions \
- -Wno-inconsistent-missing-override \
-Xclang -load -Xclang "${PLUGIN_PATH}" \
-Xclang -add-plugin -Xclang find-bad-constructs ${flags} ${1} 2>&1)"
local diffout="$(echo "${output}" | diff - "${2}")"
diff --git a/tools/clang/scripts/package.sh b/tools/clang/scripts/package.sh
index e0c0fcc..f00abb4 100755
--- a/tools/clang/scripts/package.sh
+++ b/tools/clang/scripts/package.sh
@@ -87,7 +87,7 @@ fi
${extra_flags} 2>&1 | tee -a buildlog.txt
R=$("${LLVM_BIN_DIR}/clang" --version | \
- sed -ne 's/clang version .*(trunk \([0-9]*\))/\1/p')
+ sed -ne 's/clang version .*(\([0-9]*\))/\1/p')
PDIR=clang-$R
rm -rf $PDIR
diff --git a/tools/clang/scripts/repackage.sh b/tools/clang/scripts/repackage.sh
index e19ab7e..c92447a 100755
--- a/tools/clang/scripts/repackage.sh
+++ b/tools/clang/scripts/repackage.sh
@@ -30,7 +30,7 @@ fi
"$THIS_DIR"/package.sh $@
R=$("${LLVM_BIN_DIR}/clang" --version | \
- sed -ne 's/clang version .*(trunk \([0-9]*\))/\1/p')
+ sed -ne 's/clang version .*(\([0-9]*\))/\1/p')
PDIR=clang-$R
if [ ! -f "$PDIR.tgz" ]; then
diff --git a/tools/clang/scripts/update.sh b/tools/clang/scripts/update.sh
index b585440..ad534ad 100755
--- a/tools/clang/scripts/update.sh
+++ b/tools/clang/scripts/update.sh
@@ -8,7 +8,7 @@
# Do NOT CHANGE this if you don't know what you're doing -- see
# https://code.google.com/p/chromium/wiki/UpdatingClang
# Reverting problematic clang rolls is safe, though.
-CLANG_REVISION=223109
+CLANG_REVISION=218707
THIS_DIR="$(dirname "${0}")"
LLVM_DIR="${THIS_DIR}/../../../third_party/llvm"
@@ -238,15 +238,8 @@ for i in \
"${LLVM_DIR}/test/DebugInfo/gmlt.ll" \
"${LLVM_DIR}/lib/CodeGen/SpillPlacement.cpp" \
"${LLVM_DIR}/lib/CodeGen/SpillPlacement.h" \
- "${LLVM_DIR}/lib/Transforms/Instrumentation/MemorySanitizer.cpp" \
- "${CLANG_DIR}/test/Driver/env.c" \
- "${CLANG_DIR}/lib/Frontend/InitPreprocessor.cpp" \
- "${CLANG_DIR}/test/Frontend/exceptions.c" \
- "${CLANG_DIR}/test/Preprocessor/predefined-exceptions.m" \
- "${LLVM_DIR}/test/Bindings/Go/go.test" \
; do
if [[ -e "${i}" ]]; then
- rm -f "${i}" # For unversioned files.
svn revert "${i}"
fi;
done
@@ -324,141 +317,177 @@ EOF
patch -p0
popd
-# Apply r223211: "Revert r222997."
+# Apply r218742: test: XFAIL the non-darwin gmlt test on darwin
+# Back-ported becase the test was renamed.
pushd "${LLVM_DIR}"
cat << 'EOF' |
---- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp
-+++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp
-@@ -921,8 +921,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
- Value *OriginPtr =
- getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset);
- setOrigin(A, EntryIRB.CreateLoad(OriginPtr));
-- } else {
-- setOrigin(A, getCleanOrigin());
- }
- }
- ArgOffset += RoundUpToAlignment(Size, kShadowTLSAlignment);
-@@ -942,13 +940,15 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
- /// \brief Get the origin for a value.
- Value *getOrigin(Value *V) {
- if (!MS.TrackOrigins) return nullptr;
-- if (!PropagateShadow) return getCleanOrigin();
-- if (isa<Constant>(V)) return getCleanOrigin();
-- assert((isa<Instruction>(V) || isa<Argument>(V)) &&
-- "Unexpected value type in getOrigin()");
-- Value *Origin = OriginMap[V];
-- assert(Origin && "Missing origin");
-- return Origin;
-+ if (isa<Instruction>(V) || isa<Argument>(V)) {
-+ Value *Origin = OriginMap[V];
-+ if (!Origin) {
-+ DEBUG(dbgs() << "NO ORIGIN: " << *V << "\n");
-+ Origin = getCleanOrigin();
-+ }
-+ return Origin;
-+ }
-+ return getCleanOrigin();
- }
-
- /// \brief Get the origin for i-th argument of the instruction I.
-@@ -1088,7 +1088,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
- IRB.CreateStore(getCleanShadow(&I), ShadowPtr);
-
- setShadow(&I, getCleanShadow(&I));
-- setOrigin(&I, getCleanOrigin());
- }
-
- void visitAtomicRMWInst(AtomicRMWInst &I) {
+--- a/test/DebugInfo/gmlt.ll
++++ b/test/DebugInfo/gmlt.ll
+@@ -1,2 +1,5 @@
+ ; REQUIRES: object-emission
+ ; RUN: %llc_dwarf -O0 -filetype=obj < %S/Inputs/gmlt.ll | llvm-dwarfdump - | FileCheck %S/Inputs/gmlt.ll
++
++; There's a darwin specific test in X86/gmlt, so it's okay to XFAIL this here.
++; XFAIL: darwin
EOF
patch -p1
popd
-# Apply r223219: "Preserve LD_LIBRARY_PATH when using the 'env' command"
-pushd "${CLANG_DIR}"
-cat << 'EOF' |
---- a/test/Driver/env.c
-+++ b/test/Driver/env.c
-@@ -5,12 +5,14 @@
- // REQUIRES: shell
- //
- // The PATH variable is heavily used when trying to find a linker.
--// RUN: env -i LC_ALL=C %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-+// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
-+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
- // RUN: --target=i386-unknown-linux \
- // RUN: --sysroot=%S/Inputs/basic_linux_tree \
- // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
- //
--// RUN: env -i LC_ALL=C PATH="" %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-+// RUN: env -i LC_ALL=C PATH="" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
-+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
- // RUN: --target=i386-unknown-linux \
- // RUN: --sysroot=%S/Inputs/basic_linux_tree \
- // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
-EOF
-patch -p1
-popd
-
-# Revert r220714: "Frontend: Define __EXCEPTIONS if -fexceptions is passed"
-pushd "${CLANG_DIR}"
+# Apply r218921; fixes spill placement compile-time regression.
+pushd "${LLVM_DIR}"
cat << 'EOF' |
---- a/lib/Frontend/InitPreprocessor.cpp
-+++ b/lib/Frontend/InitPreprocessor.cpp
-@@ -566,7 +566,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
- Builder.defineMacro("__BLOCKS__");
+--- a/lib/CodeGen/SpillPlacement.cpp
++++ b/lib/CodeGen/SpillPlacement.cpp
+@@ -61,27 +61,6 @@ void SpillPlacement::getAnalysisUsage(AnalysisUsage &AU) const {
+ MachineFunctionPass::getAnalysisUsage(AU);
+ }
+
+-namespace {
+-static ManagedStatic<BlockFrequency> Threshold;
+-}
+-
+-/// Decision threshold. A node gets the output value 0 if the weighted sum of
+-/// its inputs falls in the open interval (-Threshold;Threshold).
+-static BlockFrequency getThreshold() { return *Threshold; }
+-
+-/// \brief Set the threshold for a given entry frequency.
+-///
+-/// Set the threshold relative to \c Entry. Since the threshold is used as a
+-/// bound on the open interval (-Threshold;Threshold), 1 is the minimum
+-/// threshold.
+-static void setThreshold(const BlockFrequency &Entry) {
+- // Apparently 2 is a good threshold when Entry==2^14, but we need to scale
+- // it. Divide by 2^13, rounding as appropriate.
+- uint64_t Freq = Entry.getFrequency();
+- uint64_t Scaled = (Freq >> 13) + bool(Freq & (1 << 12));
+- *Threshold = std::max(UINT64_C(1), Scaled);
+-}
+-
+ /// Node - Each edge bundle corresponds to a Hopfield node.
+ ///
+ /// The node contains precomputed frequency data that only depends on the CFG,
+@@ -127,9 +106,9 @@ struct SpillPlacement::Node {
+
+ /// clear - Reset per-query data, but preserve frequencies that only depend on
+ // the CFG.
+- void clear() {
++ void clear(const BlockFrequency &Threshold) {
+ BiasN = BiasP = Value = 0;
+- SumLinkWeights = getThreshold();
++ SumLinkWeights = Threshold;
+ Links.clear();
}
-- if (!LangOpts.MSVCCompat && LangOpts.Exceptions)
-+ if (!LangOpts.MSVCCompat && LangOpts.CXXExceptions)
- Builder.defineMacro("__EXCEPTIONS");
- if (!LangOpts.MSVCCompat && LangOpts.RTTI)
- Builder.defineMacro("__GXX_RTTI");
-diff --git a/test/Frontend/exceptions.c b/test/Frontend/exceptions.c
-index 981b5b9..4bbaaa3 100644
---- a/test/Frontend/exceptions.c
-+++ b/test/Frontend/exceptions.c
-@@ -1,9 +1,6 @@
--// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -DMS_MODE -verify %s
-+// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -verify %s
- // expected-no-diagnostics
+@@ -167,7 +146,7 @@ struct SpillPlacement::Node {
--// RUN: %clang_cc1 -fms-compatibility -fexceptions -verify %s
--// expected-no-diagnostics
--
--#if defined(MS_MODE) && defined(__EXCEPTIONS)
-+#if defined(__EXCEPTIONS)
- #error __EXCEPTIONS should not be defined.
- #endif
-diff --git a/test/Preprocessor/predefined-exceptions.m b/test/Preprocessor/predefined-exceptions.m
-index 0791075..c13f429 100644
---- a/test/Preprocessor/predefined-exceptions.m
-+++ b/test/Preprocessor/predefined-exceptions.m
-@@ -1,6 +1,6 @@
- // RUN: %clang_cc1 -x objective-c -fobjc-exceptions -fexceptions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-NOCXX %s
- // CHECK-OBJC-NOCXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
--// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1
-+// CHECK-OBJC-NOCXX-NOT: #define __EXCEPTIONS 1
+ /// update - Recompute Value from Bias and Links. Return true when node
+ /// preference changes.
+- bool update(const Node nodes[]) {
++ bool update(const Node nodes[], const BlockFrequency &Threshold) {
+ // Compute the weighted sum of inputs.
+ BlockFrequency SumN = BiasN;
+ BlockFrequency SumP = BiasP;
+@@ -187,9 +166,9 @@ struct SpillPlacement::Node {
+ // 2. It helps tame rounding errors when the links nominally sum to 0.
+ //
+ bool Before = preferReg();
+- if (SumN >= SumP + getThreshold())
++ if (SumN >= SumP + Threshold)
+ Value = -1;
+- else if (SumP >= SumN + getThreshold())
++ else if (SumP >= SumN + Threshold)
+ Value = 1;
+ else
+ Value = 0;
+@@ -228,7 +207,7 @@ void SpillPlacement::activate(unsigned n) {
+ if (ActiveNodes->test(n))
+ return;
+ ActiveNodes->set(n);
+- nodes[n].clear();
++ nodes[n].clear(Threshold);
- // RUN: %clang_cc1 -x objective-c++ -fobjc-exceptions -fexceptions -fcxx-exceptions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-CXX %s
- // CHECK-OBJC-CXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
-EOF
-patch -p1
-popd
-
-# This Go bindings test doesn't work after the bootstrap build on Linux. (PR21552)
-pushd "${LLVM_DIR}"
-cat << 'EOF' |
-Index: test/Bindings/Go/go.test
-===================================================================
---- test/Bindings/Go/go.test (revision 223109)
-+++ test/Bindings/Go/go.test (working copy)
-@@ -1,3 +1,3 @@
--; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm
-+; RUN: true
+ // Very large bundles usually come from big switches, indirect branches,
+ // landing pads, or loops with many 'continue' statements. It is difficult to
+@@ -245,6 +224,18 @@ void SpillPlacement::activate(unsigned n) {
+ }
+ }
+
++/// \brief Set the threshold for a given entry frequency.
++///
++/// Set the threshold relative to \c Entry. Since the threshold is used as a
++/// bound on the open interval (-Threshold;Threshold), 1 is the minimum
++/// threshold.
++void SpillPlacement::setThreshold(const BlockFrequency &Entry) {
++ // Apparently 2 is a good threshold when Entry==2^14, but we need to scale
++ // it. Divide by 2^13, rounding as appropriate.
++ uint64_t Freq = Entry.getFrequency();
++ uint64_t Scaled = (Freq >> 13) + bool(Freq & (1 << 12));
++ Threshold = std::max(UINT64_C(1), Scaled);
++}
+
+ /// addConstraints - Compute node biases and weights from a set of constraints.
+ /// Set a bit in NodeMask for each active node.
+@@ -311,7 +302,7 @@ bool SpillPlacement::scanActiveBundles() {
+ Linked.clear();
+ RecentPositive.clear();
+ for (int n = ActiveNodes->find_first(); n>=0; n = ActiveNodes->find_next(n)) {
+- nodes[n].update(nodes);
++ nodes[n].update(nodes, Threshold);
+ // A node that must spill, or a node without any links is not going to
+ // change its value ever again, so exclude it from iterations.
+ if (nodes[n].mustSpill())
+@@ -331,7 +322,7 @@ void SpillPlacement::iterate() {
+ // First update the recently positive nodes. They have likely received new
+ // negative bias that will turn them off.
+ while (!RecentPositive.empty())
+- nodes[RecentPositive.pop_back_val()].update(nodes);
++ nodes[RecentPositive.pop_back_val()].update(nodes, Threshold);
+
+ if (Linked.empty())
+ return;
+@@ -350,7 +341,7 @@ void SpillPlacement::iterate() {
+ iteration == 0 ? Linked.rbegin() : std::next(Linked.rbegin()),
+ E = Linked.rend(); I != E; ++I) {
+ unsigned n = *I;
+- if (nodes[n].update(nodes)) {
++ if (nodes[n].update(nodes, Threshold)) {
+ Changed = true;
+ if (nodes[n].preferReg())
+ RecentPositive.push_back(n);
+@@ -364,7 +355,7 @@ void SpillPlacement::iterate() {
+ for (SmallVectorImpl<unsigned>::const_iterator I =
+ std::next(Linked.begin()), E = Linked.end(); I != E; ++I) {
+ unsigned n = *I;
+- if (nodes[n].update(nodes)) {
++ if (nodes[n].update(nodes, Threshold)) {
+ Changed = true;
+ if (nodes[n].preferReg())
+ RecentPositive.push_back(n);
+diff --git a/lib/CodeGen/SpillPlacement.h b/lib/CodeGen/SpillPlacement.h
+index 03cf5cd..622361e 100644
+--- a/lib/CodeGen/SpillPlacement.h
++++ b/lib/CodeGen/SpillPlacement.h
+@@ -62,6 +62,10 @@ class SpillPlacement : public MachineFunctionPass {
+ // Block frequencies are computed once. Indexed by block number.
+ SmallVector<BlockFrequency, 8> BlockFrequencies;
+
++ /// Decision threshold. A node gets the output value 0 if the weighted sum of
++ /// its inputs falls in the open interval (-Threshold;Threshold).
++ BlockFrequency Threshold;
++
+ public:
+ static char ID; // Pass identification, replacement for typeid.
- ; REQUIRES: shell
+@@ -152,6 +156,7 @@ private:
+ void releaseMemory() override;
+
+ void activate(unsigned);
++ void setThreshold(const BlockFrequency &Entry);
+ };
+
+ } // end namespace llvm
EOF
-patch -p0
+patch -p1
popd