[llvm] r321979 - [X86] Simplify some code in lower1BitVectorShuffle by relying on getNode's ability to constant fold vector SIGN_EXTEND.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 7 15:56:37 PST 2018
Author: ctopper
Date: Sun Jan 7 15:56:37 2018
New Revision: 321979
URL: http://llvm.org/viewvc/llvm-project?rev=321979&view=rev
Log:
[X86] Simplify some code in lower1BitVectorShuffle by relying on getNode's ability to constant fold vector SIGN_EXTEND.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=321979&r1=321978&r2=321979&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Jan 7 15:56:37 2018
@@ -14286,21 +14286,8 @@ static SDValue lower1BitVectorShuffle(co
break;
}
- if (ISD::isBuildVectorAllZeros(V1.getNode()))
- V1 = getZeroVector(ExtVT, Subtarget, DAG, DL);
- else if (ISD::isBuildVectorAllOnes(V1.getNode()))
- V1 = getOnesVector(ExtVT, DAG, DL);
- else
- V1 = DAG.getNode(ISD::SIGN_EXTEND, DL, ExtVT, V1);
-
- if (V2.isUndef())
- V2 = DAG.getUNDEF(ExtVT);
- else if (ISD::isBuildVectorAllZeros(V2.getNode()))
- V2 = getZeroVector(ExtVT, Subtarget, DAG, DL);
- else if (ISD::isBuildVectorAllOnes(V2.getNode()))
- V2 = getOnesVector(ExtVT, DAG, DL);
- else
- V2 = DAG.getNode(ISD::SIGN_EXTEND, DL, ExtVT, V2);
+ V1 = DAG.getNode(ISD::SIGN_EXTEND, DL, ExtVT, V1);
+ V2 = DAG.getNode(ISD::SIGN_EXTEND, DL, ExtVT, V2);
SDValue Shuffle = DAG.getVectorShuffle(ExtVT, DL, V1, V2, Mask);
// i1 was sign extended we can use X86ISD::CVT2MASK.
More information about the llvm-commits
mailing list