[llvm] r326044 - [TargetLowering] SimplifyDemandedVectorElts - pass demanded elts through ADD/SUB ops
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 24 12:59:14 PST 2018
Author: rksimon
Date: Sat Feb 24 12:59:14 2018
New Revision: 326044
URL: http://llvm.org/viewvc/llvm-project?rev=326044&view=rev
Log:
[TargetLowering] SimplifyDemandedVectorElts - pass demanded elts through ADD/SUB ops
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/trunk/test/CodeGen/X86/widen_conv-1.ll
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=326044&r1=326043&r2=326044&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Sat Feb 24 12:59:14 2018
@@ -1536,6 +1536,19 @@ bool TargetLowering::SimplifyDemandedVec
}
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))
Modified: llvm/trunk/test/CodeGen/X86/widen_conv-1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_conv-1.ll?rev=326044&r1=326043&r2=326044&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/widen_conv-1.ll (original)
+++ llvm/trunk/test/CodeGen/X86/widen_conv-1.ll Sat Feb 24 12:59:14 2018
@@ -8,7 +8,8 @@ define void @convert_v2i64_to_v2i32(<2 x
; 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
More information about the llvm-commits
mailing list