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