[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [llvm-bugs] [Bug 50939] New: [VectorCombine] Combining permute+blend with zero into a two-source per
From:       via llvm-bugs <llvm-bugs () lists ! llvm ! org>
Date:       2021-06-30 11:09:04
Message-ID: bug-50939-206 () http ! bugs ! llvm ! org/
[Download RAW message or body]

--1625051344.f14C1F50.9345
Date: Wed, 30 Jun 2021 04:09:04 -0700
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.llvm.org/
Auto-Submitted: auto-generated

https://bugs.llvm.org/show_bug.cgi?id=50939

            Bug ID: 50939
           Summary: [VectorCombine] Combining permute+blend with zero into
                    a two-source permute
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedbugs@nondot.org
          Reporter: lebedev.ri@gmail.com
                CC: llvm-bugs@lists.llvm.org

Not sure how useful this would be, but we could do the following:
https://godbolt.org/z/qnc87j9dd

define <4 x i32> @src(<4 x i32> %x) local_unnamed_addr #0 {
    %permil = shufflevector <4 x i32> %x, <4 x i32> poison, <4 x i32> <i32
undef, i32 0, i32 undef, i32 undef>
    %blend = shufflevector <4 x i32> <i32 0, i32 poison, i32 0, i32 0>, <4 x
i32> %permil, <4 x i32> <i32 0, i32 5, i32 2, i32 3>
    ret <4 x i32> %blend
}
define <4 x i32> @tgt(<4 x i32> %x) local_unnamed_addr #0 {
    %shuf = shufflevector <4 x i32> %x, <4 x i32> zeroinitializer, <4 x i32>
<i32 4, i32 0, i32 5, i32 6>
    ret <4 x i32> %shuf
}

Iff SK_PermuteTwoSrc is not costlier than SK_PermuteSingleSrc+SK_Select.

Though, for non-zero second source, looks like we fail to drop unneeded
vpermilps:
https://godbolt.org/z/3qhzEM933

-- 
You are receiving this mail because:
You are on the CC list for the bug.
--1625051344.f14C1F50.9345
Date: Wed, 30 Jun 2021 04:09:04 -0700
MIME-Version: 1.0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.llvm.org/
Auto-Submitted: auto-generated

<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [VectorCombine] Combining permute+blend with zero into a two-source permute"
   href="https://bugs.llvm.org/show_bug.cgi?id=50939">50939</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[VectorCombine] Combining permute+blend with zero into a two-source permute
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Transformation Utilities
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs&#64;nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>lebedev.ri&#64;gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs&#64;lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Not sure how useful this would be, but we could do the following:
<a href="https://godbolt.org/z/qnc87j9dd">https://godbolt.org/z/qnc87j9dd</a>

define &lt;4 x i32&gt; &#64;src(&lt;4 x i32&gt; %x) local_unnamed_addr #0 {
    %permil = shufflevector &lt;4 x i32&gt; %x, &lt;4 x i32&gt; poison, &lt;4 x i32&gt; &lt;i32
undef, i32 0, i32 undef, i32 undef&gt;
    %blend = shufflevector &lt;4 x i32&gt; &lt;i32 0, i32 poison, i32 0, i32 0&gt;, &lt;4 x
i32&gt; %permil, &lt;4 x i32&gt; &lt;i32 0, i32 5, i32 2, i32 3&gt;
    ret &lt;4 x i32&gt; %blend
}
define &lt;4 x i32&gt; &#64;tgt(&lt;4 x i32&gt; %x) local_unnamed_addr #0 {
    %shuf = shufflevector &lt;4 x i32&gt; %x, &lt;4 x i32&gt; zeroinitializer, &lt;4 x i32&gt;
&lt;i32 4, i32 0, i32 5, i32 6&gt;
    ret &lt;4 x i32&gt; %shuf
}

Iff SK_PermuteTwoSrc is not costlier than SK_PermuteSingleSrc+SK_Select.

Though, for non-zero second source, looks like we fail to drop unneeded
vpermilps:
<a href="https://godbolt.org/z/3qhzEM933">https://godbolt.org/z/3qhzEM933</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>
--1625051344.f14C1F50.9345--

[Attachment #3 (text/plain)]

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic