[llvm] r319725 - [X86] Use getZeroVector and remove an unnecessary creation of an APInt before calling getConstant. NFCI
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 4 17:28:04 PST 2017
Author: ctopper
Date: Mon Dec 4 17:28:04 2017
New Revision: 319725
URL: http://llvm.org/viewvc/llvm-project?rev=319725&view=rev
Log:
[X86] Use getZeroVector and remove an unnecessary creation of an APInt before calling getConstant. NFCI
The getConstant function can take care of creating the APInt internally.
getZeroVector will take care of using the correct type for the build vector to avoid re-lowering.
The test change here is because execution domain constraints apparently pass through undef inputs of a zeroing xor. So the different ordering of register allocation here caused the dependency to change.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/pr34605.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=319725&r1=319724&r2=319725&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Dec 4 17:28:04 2017
@@ -16142,10 +16142,8 @@ static SDValue LowerZERO_EXTEND_AVX512(
if (!VT.is512BitVector() && !Subtarget.hasVLX())
ExtVT = MVT::getVectorVT(MVT::getIntegerVT(512/NumElts), NumElts);
- SDValue One =
- DAG.getConstant(APInt(ExtVT.getScalarSizeInBits(), 1), DL, ExtVT);
- SDValue Zero =
- DAG.getConstant(APInt::getNullValue(ExtVT.getScalarSizeInBits()), DL, ExtVT);
+ SDValue One = DAG.getConstant(1, DL, ExtVT);
+ SDValue Zero = getZeroVector(ExtVT, Subtarget, DAG, DL);
SDValue SelectedVal = DAG.getSelect(DL, ExtVT, In, One, Zero);
if (VT == ExtVT)
Modified: llvm/trunk/test/CodeGen/X86/pr34605.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr34605.ll?rev=319725&r1=319724&r2=319725&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/pr34605.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pr34605.ll Mon Dec 4 17:28:04 2017
@@ -19,15 +19,15 @@ define void @pr34605(i8* nocapture %s, i
; CHECK-NEXT: kunpckdq %k2, %k1, %k1
; CHECK-NEXT: kandq %k1, %k0, %k1
; CHECK-NEXT: vmovdqu8 {{\.LCPI.*}}, %zmm0 {%k1} {z}
+; CHECK-NEXT: vxorps %xmm1, %xmm1, %xmm1
; CHECK-NEXT: vmovdqu32 %zmm0, (%eax)
-; CHECK-NEXT: vpxor %xmm0, %xmm0, %xmm0
-; CHECK-NEXT: vmovdqu32 %zmm0, 64(%eax)
-; CHECK-NEXT: vmovdqu32 %zmm0, 128(%eax)
-; CHECK-NEXT: vmovdqu32 %zmm0, 192(%eax)
-; CHECK-NEXT: vmovdqu32 %zmm0, 256(%eax)
-; CHECK-NEXT: vmovdqu32 %zmm0, 320(%eax)
-; CHECK-NEXT: vmovdqu32 %zmm0, 384(%eax)
-; CHECK-NEXT: vmovdqu32 %zmm0, 448(%eax)
+; CHECK-NEXT: vmovups %zmm1, 64(%eax)
+; CHECK-NEXT: vmovups %zmm1, 128(%eax)
+; CHECK-NEXT: vmovups %zmm1, 192(%eax)
+; CHECK-NEXT: vmovups %zmm1, 256(%eax)
+; CHECK-NEXT: vmovups %zmm1, 320(%eax)
+; CHECK-NEXT: vmovups %zmm1, 384(%eax)
+; CHECK-NEXT: vmovups %zmm1, 448(%eax)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retl
entry:
More information about the llvm-commits
mailing list