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

            Bug ID: 29126
           Summary: [InstCombine] fold insertelement of constant into
                    shufflevector with constant operand
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: spatel+l...@rotateright.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

define <4 x float> @goo(<4 x float> %x) {
  %shuf = shufflevector <4 x float> %x, <4 x float> <float undef, float 1.0,
float 2.0, float undef>, <4 x i32><i32 0, i32 5, i32 6, i32 3>
  %ins = insertelement <4 x float> %shuf, float 3.0, i32 3
  ret <4 x float> %ins
}

The insert constant should combine with the shuffle constant:

define <4 x float> @hoo(<4 x float> %x) {
  %shuf = shufflevector <4 x float> %x, <4 x float> <float undef, float 1.0,
float 2.0, float 3.0>, <4 x i32><i32 0, i32 5, i32 6, i32 7>
  ret <4 x float> %shuf
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to