1 //===- GIMatchDagPredicateDependencyEdge.cpp - Have inputs before check ---===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "GIMatchDagPredicateDependencyEdge.h" 10 11 #include "GIMatchDagInstr.h" 12 #include "GIMatchDagOperands.h" 13 #include "GIMatchDagPredicate.h" 14 15 #include "llvm/Support/raw_ostream.h" 16 17 using namespace llvm; 18 19 LLVM_DUMP_METHOD void print(raw_ostream & OS) const20GIMatchDagPredicateDependencyEdge::print(raw_ostream &OS) const { 21 OS << getRequiredMI()->getName(); 22 if (getRequiredMO()) 23 OS << "[" << getRequiredMO()->getName() << "]"; 24 OS << " ==> " << getPredicate()->getName() << "[" 25 << getPredicateOp()->getName() << "]"; 26 } 27 28 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) dump() const29LLVM_DUMP_METHOD void GIMatchDagPredicateDependencyEdge::dump() const { 30 print(errs()); 31 } 32 #endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 33 operator <<(raw_ostream & OS,const GIMatchDagPredicateDependencyEdge & E)34raw_ostream &llvm::operator<<(raw_ostream &OS, 35 const GIMatchDagPredicateDependencyEdge &E) { 36 E.print(OS); 37 return OS; 38 } 39