[llvm] [AArch64] canCreateUndefOrPoisonForTargetNode - AArch64ISD::VASHR can't create undef/poison (PR #156445)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 04:44:14 PDT 2025


================
@@ -93,7 +92,8 @@ define <2 x double> @test_compress_v2f64(<2 x double> %vec, <2 x i1> %mask) {
 ; CHECK-NEXT:    shl.2d v1, v1, #63
 ; CHECK-NEXT:    cmlt.2d v1, v1, #0
 ; CHECK-NEXT:    fmov x9, d1
-; CHECK-NEXT:    bfi x8, x9, #3, #1
+; CHECK-NEXT:    and x9, x9, #0x8
+; CHECK-NEXT:    orr x8, x8, x9
----------------
RKSimon wrote:

I haven't entirely worked out what's going on here - but we've gone from:
```
    t24: v2i64 = AArch64ISD::VASHR t23, Constant:i32<63>
    t55: v2i64 = freeze t24
    t32: i64 = extract_vector_elt t55, Constant:i64<0>
    t53: i64 = shl t32, Constant:i64<3>
    t54: i64 = and t53, Constant:i64<8>
    t49: i64 = or disjoint FrameIndex:i64<0>, t54
```
to (what should be better):
```
    t56: v2i64 = freeze t23
    t24: v2i64 = AArch64ISD::VASHR t56, Constant:i32<63>
	t32: i64 = extract_vector_elt t24, Constant:i64<0>
    t54: i64 = and t32, Constant:i64<8>
    t49: i64 = or FrameIndex:i64<0>, t54
```
I suppose we now know the extracted element is all sign bits - but that screws up the BFI isel somehow?

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


More information about the llvm-commits mailing list