[llvm-bugs] [Bug 30264] New: [InstCombine] reduce shuffles with constants to a single shuffle

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 2 13:01:32 PDT 2016


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

            Bug ID: 30264
           Summary: [InstCombine] reduce shuffles with constants to a
                    single shuffle
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

I noticed this case in https://reviews.llvm.org/D24182 :

define <4 x float> @insertConstants(<4 x float> %x) {
  %shuf1 = shufflevector <4 x float> %x, <4 x float> <float undef, float 0.0,
float undef, float undef>, <4 x i32> <i32 0, i32 5, i32 undef, i32 undef>
  %shuf2 = shufflevector <4 x float> %shuf1, <4 x float> <float undef, float
undef, float 4.0, float 1.0>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
  ret <4 x float> %shuf2
}


This can be combined into one shuffle instruction that we can assume is as
cheap as either of the original ones:

shufflevector <4 x float> %x, <4 x float> <float undef, float 0.0, float 4.0,
float 1.0>, <4 x i32> <i32 0, i32 5, i32 6, i32 7>

-- 
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/20160902/476790c4/attachment.html>


More information about the llvm-bugs mailing list