chromium/v8/src/compiler/use-info.h

// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_COMPILER_USE_INFO_H_
#define V8_COMPILER_USE_INFO_H_

#include "src/base/functional.h"
#include "src/codegen/machine-type.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/globals.h"

namespace v8::internal::compiler {

// Enum to specify if `+0` and `-0` should be treated as the same value.
enum IdentifyZeros : uint8_t {};

class Truncation;
size_t hash_value(const Truncation&);

class Truncation final {};

inline size_t hash_value(const Truncation& truncation) {}

inline std::ostream& operator<<(std::ostream& os,
                                const Truncation& truncation) {}

enum class TypeCheckKind : uint8_t {};

inline std::ostream& operator<<(std::ostream& os, TypeCheckKind type_check) {}

// The {UseInfo} class is used to describe a use of an input of a node.
//
// This information is used in two different ways, based on the phase:
//
// 1. During propagation, the use info is used to inform the input node
//    about what part of the input is used (we call this truncation) and what
//    is the preferred representation. For conversions that will require
//    checks, we also keep track of whether a minus zero check is needed.
//
// 2. During lowering, the use info is used to properly convert the input
//    to the preferred representation. The preferred representation might be
//    insufficient to do the conversion (e.g. word32->float64 conv), so we also
//    need the signedness information to produce the correct value.
//    Additionally, use info may contain {CheckParameters} which contains
//    information for the deoptimizer such as a CallIC on which speculation
//    should be disallowed if the check fails.
class UseInfo {};

inline bool operator==(const UseInfo& lhs, const UseInfo& rhs) {}

inline size_t hash_value(const UseInfo& use_info) {}

inline std::ostream& operator<<(std::ostream& os, const UseInfo& use_info) {}

}  // namespace v8::internal::compiler

#endif  // V8_COMPILER_USE_INFO_H_