[beignet] 01/04: Remove sometimes-broken optimization. (Closes: #885423)

Rebecca Palmer rnpalmer-guest at moszumanska.debian.org
Tue Mar 13 22:42:43 UTC 2018


This is an automated email from the git hooks/post-receive script.

rnpalmer-guest pushed a commit to branch master
in repository beignet.

commit c050b56843482eddb7add347a09b5f7f93d48dac
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date:   Tue Mar 13 07:20:17 2018 +0000

    Remove sometimes-broken optimization.  (Closes: #885423)
---
 debian/changelog            |  6 ++++
 debian/patches/885423.patch | 82 +++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series       |  1 +
 3 files changed, 89 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index cf2454c..f14d372 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+beignet (1.3.2-2) UNRELEASED; urgency=medium
+
+  * Remove sometimes-broken optimization.  (Closes: #885423)
+
+ -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Tue, 13 Mar 2018 07:17:57 +0000
+
 beignet (1.3.2-1) unstable; urgency=medium
 
   * New upstream release.  (Closes: #882484)
diff --git a/debian/patches/885423.patch b/debian/patches/885423.patch
new file mode 100644
index 0000000..11d9a4e
--- /dev/null
+++ b/debian/patches/885423.patch
@@ -0,0 +1,82 @@
+Description: Fix self-test fail in some conditions
+
+Reverts upstream 81755054c4c19d821e58456a1a7d601806e60e92
+
+Known triggers are Darktable and the GEGL test suite
+
+Note that this does *not* fix the other Darktable issue
+(https://bugs.freedesktop.org/show_bug.cgi?id=101485): beignet still
+needs to be blacklisted in Darktable (which it is by default).
+
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102137
+Bug-Debian: https://bugs.debian.org/885423
+
+diff --git b/backend/src/backend/gen_insn_selection_optimize.cpp a/backend/src/backend/gen_insn_selection_optimize.cpp
+index 07547ec4..d2e0fb9b 100644
+--- b/backend/src/backend/gen_insn_selection_optimize.cpp
++++ a/backend/src/backend/gen_insn_selection_optimize.cpp
+@@ -74,7 +74,8 @@ namespace gbe
+                   const GenRegister& replacement) :
+                   insn(insn), intermedia(intermedia), replacement(replacement)
+       {
+-        assert(insn.opcode == SEL_OP_MOV || insn.opcode == SEL_OP_ADD);
++        assert(insn.opcode == SEL_OP_MOV);
++        assert(&(insn.src(0)) == &replacement);
+         assert(&(insn.dst(0)) == &intermedia);
+         this->elements = CalculateElements(intermedia, insn.state.execWidth);
+         replacementOverwritten = false;
+@@ -101,7 +102,6 @@ namespace gbe
+     void doReplacement(ReplaceInfo* info);
+     bool CanBeReplaced(const ReplaceInfo* info, const SelectionInstruction& insn, const GenRegister& var);
+     void cleanReplaceInfoMap();
+-    void doNegAddOptimization(SelectionInstruction &insn);
+ 
+     SelectionBlock &bb;
+     const ir::Liveness::LiveOut& liveout;
+@@ -159,13 +159,8 @@ namespace gbe
+ 
+   void SelBasicBlockOptimizer::addToReplaceInfoMap(SelectionInstruction& insn)
+   {
+-    assert(insn.opcode == SEL_OP_MOV || insn.opcode == SEL_OP_ADD);
+-    GenRegister &src = insn.src(0);
+-    if (insn.opcode == SEL_OP_ADD) {
+-      if (src.file == GEN_IMMEDIATE_VALUE)
+-        src = insn.src(1);
+-    }
+-
++    assert(insn.opcode == SEL_OP_MOV);
++    const GenRegister& src = insn.src(0);
+     const GenRegister& dst = insn.dst(0);
+     if (src.type != dst.type || src.file != dst.file)
+       return;
+@@ -254,29 +249,10 @@ namespace gbe
+ 
+       if (insn.opcode == SEL_OP_MOV)
+         addToReplaceInfoMap(insn);
+-
+-      doNegAddOptimization(insn);
+     }
+     cleanReplaceInfoMap();
+   }
+ 
+-  /* LLVM transform Mad(a, -b, c) to
+-     Add b, -b, 0
+-     Mad val, a, b, c
+-     for Gen support negtive modifier, mad(a, -b, c) is native suppoted.
+-     Also it can be used for the same like instruction sequence.
+-     Do it just like a:  mov b, -b, so it is a Mov operation like LocalCopyPropagation
+-  */
+-  void SelBasicBlockOptimizer::doNegAddOptimization(SelectionInstruction &insn) {
+-    if (insn.opcode == SEL_OP_ADD) {
+-      GenRegister src0 = insn.src(0);
+-      GenRegister src1 = insn.src(1);
+-      if ((src0.negation && src1.file == GEN_IMMEDIATE_VALUE && src1.value.f == 0.0f) ||
+-          (src1.negation && src0.file == GEN_IMMEDIATE_VALUE && src0.value.f == 0.0f))
+-        addToReplaceInfoMap(insn);
+-    }
+-  }
+-
+   void SelBasicBlockOptimizer::run()
+   {
+     for (size_t i = 0; i < MaxTries; ++i) {
diff --git a/debian/patches/series b/debian/patches/series
index 6c08657..6de50a1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ add-appstream-metadata.patch
 static-llvm.patch
 grammar.patch
 clearer-type-errors.patch
+885423.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git



More information about the Pkg-opencl-commits mailing list