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 "GIMatchDagPredicate.h"
13
14#include "llvm/Support/raw_ostream.h"
15
16using namespace llvm;
17
18LLVM_DUMP_METHOD void
19GIMatchDagPredicateDependencyEdge::print(raw_ostream &OS) const {
20  OS << getRequiredMI()->getName();
21  if (getRequiredMO())
22    OS << "[" << getRequiredMO()->getName() << "]";
23  OS << " ==> " << getPredicate()->getName() << "["
24     << getPredicateOp()->getName() << "]";
25}
26
27#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
28LLVM_DUMP_METHOD void GIMatchDagPredicateDependencyEdge::dump() const {
29  print(errs());
30}
31#endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
32
33raw_ostream &llvm::operator<<(raw_ostream &OS,
34                              const GIMatchDagPredicateDependencyEdge &E) {
35  E.print(OS);
36  return OS;
37}
38