[llvm-bugs] [Bug 31880] shuffle and vectorize repeated scalar ops on extracted elements

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 8 09:21:42 PDT 2017


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

Simon Pilgrim <llvm-dev at redking.me.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
 Fixed By Commit(s)|                            |309812

--- Comment #2 from Simon Pilgrim <llvm-dev at redking.me.uk> ---
Fixed in trunk by rL309812:

opt pr31880.ll -S -slp-vectorizer

define <2 x i8> @g(<2 x i8> %x, <2 x i8> %y) {
  %x0 = extractelement <2 x i8> %x, i32 0
  %y1 = extractelement <2 x i8> %y, i32 1
  %1 = insertelement <2 x i8> undef, i8 %x0, i32 0
  %2 = insertelement <2 x i8> %1, i8 %y1, i32 1
  %3 = mul <2 x i8> %2, %2
  %4 = extractelement <2 x i8> %3, i32 0
  %ins1 = insertelement <2 x i8> undef, i8 %4, i32 0
  %5 = extractelement <2 x i8> %3, i32 1
  %ins2 = insertelement <2 x i8> %ins1, i8 %5, i32 1
  ret <2 x i8> %ins2
}

opt pr31880.ll -S -slp-vectorizer -instcombine

define <2 x i8> @g(<2 x i8> %x, <2 x i8> %y) {
  %1 = shufflevector <2 x i8> %x, <2 x i8> %y, <2 x i32> <i32 0, i32 3>
  %2 = mul <2 x i8> %1, %1
  ret <2 x i8> %2
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170908/5f6f59aa/attachment.html>


More information about the llvm-bugs mailing list