xref: /llvm-project/llvm/lib/Support/InstructionCost.cpp (revision 9b76160e53f67008ff21095098129a2949595a06)
1*9b76160eSDavid Sherwood //===- InstructionCost.cpp --------------------------------------*- C++ -*-===//
2*9b76160eSDavid Sherwood //
3*9b76160eSDavid Sherwood // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*9b76160eSDavid Sherwood // See https://llvm.org/LICENSE.txt for license information.
5*9b76160eSDavid Sherwood // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*9b76160eSDavid Sherwood //
7*9b76160eSDavid Sherwood //===----------------------------------------------------------------------===//
8*9b76160eSDavid Sherwood /// \file
9*9b76160eSDavid Sherwood /// This file includes the function definitions for the InstructionCost class
10*9b76160eSDavid Sherwood /// that is used when calculating the cost of an instruction, or a group of
11*9b76160eSDavid Sherwood /// instructions.
12*9b76160eSDavid Sherwood //===----------------------------------------------------------------------===//
13*9b76160eSDavid Sherwood 
14*9b76160eSDavid Sherwood #include "llvm/Support/InstructionCost.h"
15*9b76160eSDavid Sherwood #include "llvm/Support/raw_ostream.h"
16*9b76160eSDavid Sherwood 
17*9b76160eSDavid Sherwood using namespace llvm;
18*9b76160eSDavid Sherwood 
print(raw_ostream & OS) const19*9b76160eSDavid Sherwood void InstructionCost::print(raw_ostream &OS) const {
20*9b76160eSDavid Sherwood   if (isValid())
21*9b76160eSDavid Sherwood     OS << Value;
22*9b76160eSDavid Sherwood   else
23*9b76160eSDavid Sherwood     OS << "Invalid";
24*9b76160eSDavid Sherwood }
25