mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[TargetLowering] SimplifyDemandedVectorElts - pass demanded elts through ADD/SUB ops
llvm-svn: 326044
This commit is contained in:
parent
206b702ccd
commit
a2888f250b
@ -1536,6 +1536,19 @@ bool TargetLowering::SimplifyDemandedVectorElts(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ISD::ADD:
|
||||
case ISD::SUB: {
|
||||
APInt SrcUndef, SrcZero;
|
||||
if (SimplifyDemandedVectorElts(Op.getOperand(1), DemandedElts, SrcUndef,
|
||||
SrcZero, TLO, Depth + 1))
|
||||
return true;
|
||||
if (SimplifyDemandedVectorElts(Op.getOperand(0), DemandedElts, KnownUndef,
|
||||
KnownZero, TLO, Depth + 1))
|
||||
return true;
|
||||
KnownZero &= SrcZero;
|
||||
KnownUndef &= SrcUndef;
|
||||
break;
|
||||
}
|
||||
case ISD::TRUNCATE:
|
||||
if (SimplifyDemandedVectorElts(Op.getOperand(0), DemandedElts, KnownUndef,
|
||||
KnownZero, TLO, Depth + 1))
|
||||
|
@ -8,7 +8,8 @@ define void @convert_v2i64_to_v2i32(<2 x i32>* %dst.addr, <2 x i64> %src) nounwi
|
||||
; X86-LABEL: convert_v2i64_to_v2i32:
|
||||
; X86: # %bb.0: # %entry
|
||||
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
|
||||
; X86-NEXT: paddd {{\.LCPI.*}}, %xmm0
|
||||
; X86-NEXT: pcmpeqd %xmm1, %xmm1
|
||||
; X86-NEXT: psubd %xmm1, %xmm0
|
||||
; X86-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
|
||||
; X86-NEXT: movq %xmm0, (%eax)
|
||||
; X86-NEXT: retl
|
||||
|
Loading…
x
Reference in New Issue
Block a user