[llvm] r364076 - [DAGCombine] narrowExtractedVectorBinOp - pull out repeated getOpcode(). NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 09:44:51 PDT 2019


Author: rksimon
Date: Fri Jun 21 09:44:51 2019
New Revision: 364076

URL: http://llvm.org/viewvc/llvm-project?rev=364076&view=rev
Log:
[DAGCombine] narrowExtractedVectorBinOp - pull out repeated getOpcode(). NFCI.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=364076&r1=364075&r2=364076&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Jun 21 09:44:51 2019
@@ -17937,7 +17937,8 @@ static SDValue narrowExtractedVectorBinO
   // feeding an extract subvector.
   const TargetLowering &TLI = DAG.getTargetLoweringInfo();
   SDValue BinOp = peekThroughBitcasts(Extract->getOperand(0));
-  if (!TLI.isBinOp(BinOp.getOpcode()) || BinOp.getNode()->getNumValues() != 1)
+  unsigned BOpcode = BinOp.getOpcode();
+  if (!TLI.isBinOp(BOpcode) || BinOp.getNode()->getNumValues() != 1)
     return SDValue();
 
   // The binop must be a vector type, so we can extract some fraction of it.
@@ -17966,7 +17967,6 @@ static SDValue narrowExtractedVectorBinO
   // Bail out if the target does not support a narrower version of the binop.
   EVT NarrowBVT = EVT::getVectorVT(*DAG.getContext(), WideBVT.getScalarType(),
                                    WideNumElts / NarrowingRatio);
-  unsigned BOpcode = BinOp.getOpcode();
   if (!TLI.isOperationLegalOrCustomOrPromote(BOpcode, NarrowBVT))
     return SDValue();
 




More information about the llvm-commits mailing list