[llvm-bugs] [Bug 45773] New: [MergeFuncs] Shufflevectors with different mask merged

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 1 12:39:04 PDT 2020


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

            Bug ID: 45773
           Summary: [MergeFuncs] Shufflevectors with different mask merged
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: nikita.ppv at gmail.com
                CC: llvm-bugs at lists.llvm.org

opt -mergefunc

define internal <2 x i32> @test1(<2 x i32> %v1, <2 x i32> %v2) {
  %x = shufflevector <2 x i32> %v1, <2 x i32> %v2, <2 x i32> <i32 0, i32 1>
  ret <2 x i32> %x
}

define internal <2 x i32> @test2(<2 x i32> %v1, <2 x i32> %v2) {
  %x = shufflevector <2 x i32> %v1, <2 x i32> %v2, <2 x i32> <i32 1, i32 0>
  ret <2 x i32> %x
}

define void @caller(<2 x i32> %v1, <2 x i32> %v2) {
  call <2 x i32> @test1(<2 x i32> %v1, <2 x i32> %v2)
  call <2 x i32> @test2(<2 x i32> %v1, <2 x i32> %v2)
  ret void 
}   

Results in:

define internal <2 x i32> @test1(<2 x i32> %v1, <2 x i32> %v2) {
  %x = shufflevector <2 x i32> %v1, <2 x i32> %v2, <2 x i32> <i32 0, i32 1>
  ret <2 x i32> %x
}

define void @caller(<2 x i32> %v1, <2 x i32> %v2) {
  %1 = call <2 x i32> @test1(<2 x i32> %v1, <2 x i32> %v2)
  %2 = call <2 x i32> @test1(<2 x i32> %v1, <2 x i32> %v2)
  ret void
}

This is due to the recent migration from an operand to special state.

-- 
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/20200501/5653d392/attachment.html>


More information about the llvm-bugs mailing list