Issue 153570
Summary [X86] Selection failure with llvm.x86.avx512fp16.mask.mul.sh.round
Labels backend:X86, crash
Assignees
Reporter nikic
    https://llvm.godbolt.org/z/cad6zh3Ys
```llvm
; RUN: llc -mattr=+avx512fp16 < %s
define <8 x half> @test_mm_maskz_mul_round_sh(ptr %p) {
  %r = tail call <8 x half> @llvm.x86.avx512fp16.mask.mul.sh.round(<8 x half> <half 0xH3C00, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000>, <8 x half> <half 0xH4000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000>, <8 x half> zeroinitializer, i8 0, i32 8)
  store <8 x half> %r, ptr %p, align 16
  %r1 = tail call <8 x half> @llvm.x86.avx512fp16.mask.mul.sh.round(<8 x half> <half 0xH3C00, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000>, <8 x half> <half 0xH4000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000, half 0xH0000>, <8 x half> zeroinitializer, i8 1, i32 8)
  ret <8 x half> %r1
}
```

```
LLVM ERROR: Cannot select: t26: v8f16 = X86ISD::SELECTS t45, t22, t9
  t45: v1i1 = BUILD_VECTOR Constant:i8<0>
 t22: v8f16 = X86ISD::FMULS_RND t43, t42, TargetConstant:i32<0>
    t43: v8f16,ch = X86ISD::VZEXT_LOAD<(load (s16) from constant-pool)> t0, t37
 t37: i64 = X86ISD::Wrapper TargetConstantPool:i64<half 0xH3C00> 0
    t42: v8f16,ch = X86ISD::VZEXT_LOAD<(load (s16) from constant-pool)> t0, t39
 t39: i64 = X86ISD::Wrapper TargetConstantPool:i64<half 0xH4000> 0
  t9: v8f16 = BUILD_VECTOR ConstantFP:f16<APFloat(0)>, ConstantFP:f16<APFloat(0)>, ConstantFP:f16<APFloat(0)>, ConstantFP:f16<APFloat(0)>, ConstantFP:f16<APFloat(0)>, ConstantFP:f16<APFloat(0)>, ConstantFP:f16<APFloat(0)>, ConstantFP:f16<APFloat(0)>
```

The selection failure for the reduced test case is not new, but we've only started hitting this with LLVM 21, probably due to IR optimization changes.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to