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: unassignedb...@nondot.org
          Reporter: nikita....@gmail.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to