[llvm] [SDag] Notify listeners when deleting a node (PR #66991)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 20:12:01 PDT 2024


================
@@ -4353,8 +4353,8 @@ define <16 x i16> @shuffle_v16i16_06_06_07_05_01_06_04_11_14_14_15_13_09_14_12_1
 ;
 ; AVX2-SLOW-LABEL: shuffle_v16i16_06_06_07_05_01_06_04_11_14_14_15_13_09_14_12_11:
 ; AVX2-SLOW:       # %bb.0:
-; AVX2-SLOW-NEXT:    vpmovsxbd {{.*#+}} ymm1 = [0,5,2,3,4,5,6,7]
-; AVX2-SLOW-NEXT:    vpermd %ymm0, %ymm1, %ymm0
+; AVX2-SLOW-NEXT:    vpermq {{.*#+}} ymm1 = ymm0[2,3,2,3]
+; AVX2-SLOW-NEXT:    vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2,3,4],ymm1[5],ymm0[6,7]
----------------
s-barannikov wrote:

Before this patch we have:
```
          t32: v4i64 = X86ISD::VPERMI t12, TargetConstant:i8<78>
        t39: v4i64 = vector_shuffle<4,5,2,3> t12, t32
      t40: v8i32 = bitcast t39
    t57: v8i32 = X86ISD::BLENDI t53, t40, TargetConstant:i8<34>
```
which gets combined into 
```
t67: v8i32 = X86ISD::VPERMV t66, t53
```

After this patch we have:
```
        t62: v4i64 = X86ISD::VPERMI t12, TargetConstant:i8<-18>
      t40: v8i32 = bitcast t62
    t57: v8i32 = X86ISD::BLENDI t53, t40, TargetConstant:i8<34>
```
This doesn't get combined because the chain isn't "deep enough" (Depth = 1) according to this check in combineX86ShuffleChain:
```
  // Depth threshold above which we can efficiently use variable mask shuffles.
  int VariableCrossLaneShuffleDepth =
      Subtarget.hasFastVariableCrossLaneShuffle() ? 1 : 2;
...
  AllowVariableCrossLaneMask &=
      (Depth >= VariableCrossLaneShuffleDepth) || HasVariableMask;
```


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


More information about the llvm-commits mailing list