[llvm] c00a277 - [X86][AVX] Remove redundant EXTRACT_VECTOR_ELT(VBROADCAST(SCALAR())) fold

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 02:21:03 PDT 2020


Author: Simon Pilgrim
Date: 2020-07-08T10:18:36+01:00
New Revision: c00a27752e4944db609a683504bb10e0975fdf76

URL: https://github.com/llvm/llvm-project/commit/c00a27752e4944db609a683504bb10e0975fdf76
DIFF: https://github.com/llvm/llvm-project/commit/c00a27752e4944db609a683504bb10e0975fdf76.diff

LOG: [X86][AVX] Remove redundant EXTRACT_VECTOR_ELT(VBROADCAST(SCALAR())) fold

Noticed while looking for similar cases to rG931ec74f7a29 - SimplifyDemandedVectorElts and shuffle combining both should handle this now.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 023b5975f0c7..5238014008be 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -38963,9 +38963,6 @@ static SDValue combineExtractWithShuffle(SDNode *N, SelectionDAG &DAG,
   // Handle extract(bitcast(broadcast(scalar_value))).
   if (X86ISD::VBROADCAST == SrcBC.getOpcode()) {
     SDValue SrcOp = SrcBC.getOperand(0);
-    if (SrcOp.getValueSizeInBits() == VT.getSizeInBits())
-      return DAG.getBitcast(VT, SrcOp);
-
     EVT SrcOpVT = SrcOp.getValueType();
     if (SrcOpVT.isScalarInteger() && VT.isInteger() &&
         (SrcOpVT.getSizeInBits() % SrcEltBits) == 0) {


        


More information about the llvm-commits mailing list