]> granicus.if.org Git - llvm/commitdiff
[DAGCombiner] Use SDNode::isOperandOf to simplify some code. NFCI
authorCraig Topper <craig.topper@intel.com>
Tue, 23 Jul 2019 05:13:35 +0000 (05:13 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 23 Jul 2019 05:13:35 +0000 (05:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366778 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index eabbef573f24d3c88647e2efc065e99e0f702454..00a4c0685cc437047ad3f66ad3e630dda2f735f2 100644 (file)
@@ -14829,13 +14829,7 @@ CheckForMaskedLoad(SDValue V, SDValue Ptr, SDValue Chain) {
   else if (Chain->getOpcode() == ISD::TokenFactor &&
            SDValue(LD, 1).hasOneUse()) {
     // LD has only 1 chain use so they are no indirect dependencies.
-    bool isOk = false;
-    for (const SDValue &ChainOp : Chain->op_values())
-      if (ChainOp.getNode() == LD) {
-        isOk = true;
-        break;
-      }
-    if (!isOk)
+    if (!LD->isOperandOf(Chain.getNode()))
       return Result;
   } else
     return Result; // Fail.