1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-- -mattr=avx512bw | FileCheck %s
4 ; This would infinite loop by trying to truncate to i16 and then promote back to i32.
6 define i16 @PR40793(<8 x i16> %t1) {
7 ; CHECK-LABEL: PR40793:
9 ; CHECK-NEXT: vpextrw $5, %xmm0, %ecx
10 ; CHECK-NEXT: andb $15, %cl
11 ; CHECK-NEXT: movl $32733, %eax # imm = 0x7FDD
12 ; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
13 ; CHECK-NEXT: shrl %cl, %eax
14 ; CHECK-NEXT: # kill: def $ax killed $ax killed $eax
16 %t2 = and <8 x i16> %t1, <i16 15, i16 15, i16 15, i16 15, i16 15, i16 15, i16 15, i16 15>
17 %t3 = lshr <8 x i16> <i16 25156, i16 -14844, i16 -26779, i16 -16956, i16 -13978, i16 32733, i16 -24894, i16 18530>, %t2
18 %t4 = bitcast <8 x i16> %t3 to <2 x double>
19 %t5 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %t4)
20 %t6 = bitcast <2 x double> %t5 to <8 x i16>
21 %t7 = extractelement <8 x i16> %t6, i64 5
25 declare <2 x double> @llvm.fabs.v2f64(<2 x double>)