]> granicus.if.org Git - llvm/commitdiff
[DAGCombine] narrowExtractedVectorBinOp - pull out repeated getOpcode(). NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 21 Jun 2019 16:44:51 +0000 (16:44 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 21 Jun 2019 16:44:51 +0000 (16:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364076 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 4f4f502442d803ae6df0a85ec8cbf812eef1959d..68f6a1becaecd667813bd88f92bf66d989b9e48b 100644 (file)
@@ -17937,7 +17937,8 @@ static SDValue narrowExtractedVectorBinOp(SDNode *Extract, SelectionDAG &DAG) {
   // 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 narrowExtractedVectorBinOp(SDNode *Extract, SelectionDAG &DAG) {
   // 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();