[llvm] r284949 - Use SDValue::getConstantOperandVal() helper. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 23 13:17:21 PDT 2016


Author: rksimon
Date: Sun Oct 23 15:17:21 2016
New Revision: 284949

URL: http://llvm.org/viewvc/llvm-project?rev=284949&view=rev
Log:
Use SDValue::getConstantOperandVal() helper. 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=284949&r1=284948&r2=284949&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Oct 23 15:17:21 2016
@@ -13037,10 +13037,7 @@ SDValue DAGCombiner::createBuildVecShuff
     if (VectorMask[i] <= 0)
       continue;
 
-    SDValue Extract = N->getOperand(i);
-    unsigned ExtIndex =
-        cast<ConstantSDNode>(Extract.getOperand(1))->getZExtValue();
-
+    unsigned ExtIndex = N->getOperand(i).getConstantOperandVal(1);
     if (VectorMask[i] == (int)LeftIdx) {
       Mask[i] = ExtIndex;
     } else if (VectorMask[i] == (int)LeftIdx + 1) {




More information about the llvm-commits mailing list