[DAG] canCreateUndefOrPoison - add freeze(insert_subvector(x,y,c)) -> insert_subvector(freeze(x),freeze(y),c) support

We already have plenty of assertions in place to ensure that the insertion index is constant and inrange
This commit is contained in:
Simon Pilgrim 2022-09-03 13:41:33 +01:00
parent 3968844bff
commit 62cdfdab4d
2 changed files with 2 additions and 3 deletions

View File

@ -4603,6 +4603,7 @@ bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
case ISD::AssertSext:
case ISD::AssertZext:
case ISD::FREEZE:
case ISD::INSERT_SUBVECTOR:
case ISD::AND:
case ISD::OR:
case ISD::XOR:

View File

@ -5,9 +5,7 @@
define <4 x i32> @freeze_insert_subvector(<8 x i32> %a0) nounwind {
; CHECK-LABEL: freeze_insert_subvector:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovaps %xmm0, %xmm0
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm0
; CHECK-NEXT: ret{{[l|q]}}
%x = shufflevector <8 x i32> %a0, <8 x i32> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
%y = freeze <8 x i32> %x