[llvm] processtiedpairs (PR #65976)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 09:23:37 PDT 2023


================
@@ -235,15 +236,26 @@ define <4 x i32> @test17(<4 x i32> %a, <4 x i32> %b) {
 
 
 define <4 x i32> @test18(<4 x i32> %a, <4 x i32> %b) {
-; CHECK-LABEL: test18:
-; CHECK:       # %bb.0:
-; CHECK-NEXT:    pxor %xmm2, %xmm2
-; CHECK-NEXT:    pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3,4,5,6,7]
-; CHECK-NEXT:    pshufd {{.*#+}} xmm0 = xmm0[1,0,1,1]
-; CHECK-NEXT:    pblendw {{.*#+}} xmm2 = xmm1[0,1],xmm2[2,3,4,5,6,7]
-; CHECK-NEXT:    por %xmm0, %xmm2
-; CHECK-NEXT:    movdqa %xmm2, %xmm0
-; CHECK-NEXT:    retq
+; CHECK-LV-LABEL: test18:
+; CHECK-LV:       # %bb.0:
+; CHECK-LV-NEXT:    pxor %xmm2, %xmm2
+; CHECK-LV-NEXT:    pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3,4,5,6,7]
+; CHECK-LV-NEXT:    pshufd {{.*#+}} xmm0 = xmm0[1,0,1,1]
+; CHECK-LV-NEXT:    pblendw {{.*#+}} xmm2 = xmm1[0,1],xmm2[2,3,4,5,6,7]
+; CHECK-LV-NEXT:    por %xmm0, %xmm2
+; CHECK-LV-NEXT:    movdqa %xmm2, %xmm0
+; CHECK-LV-NEXT:    retq
+;
+; CHECK-LIS-LABEL: test18:
+; CHECK-LIS:       # %bb.0:
+; CHECK-LIS-NEXT:    pxor %xmm2, %xmm2
+; CHECK-LIS-NEXT:    pxor %xmm3, %xmm3
+; CHECK-LIS-NEXT:    pblendw {{.*#+}} xmm3 = xmm0[0,1],xmm3[2,3,4,5,6,7]
+; CHECK-LIS-NEXT:    pshufd {{.*#+}} xmm0 = xmm3[1,0,1,1]
+; CHECK-LIS-NEXT:    pblendw {{.*#+}} xmm2 = xmm1[0,1],xmm2[2,3,4,5,6,7]
+; CHECK-LIS-NEXT:    por %xmm0, %xmm2
+; CHECK-LIS-NEXT:    movdqa %xmm2, %xmm0
----------------
jayfoad wrote:

Regression here but I don't think TwoAddressInstruction is doing anything wrong. I can see RegisterCoalescer rematerializing a V_SET0 in a slightly unfortunate place which causes overlapping lifetimes for (a) one value that wants to use $xmm0 on input and (b) another value that wants to use $xmm0 on return, so one of them has to pick a different register and that causes the extra COPY.

https://github.com/llvm/llvm-project/pull/65976


More information about the llvm-commits mailing list