//===- ConstantFPRange.h - Represent a range for floating-point -*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Represent a range of possible values that may occur when the program is run // for a floating-point value. This keeps track of a lower and upper bound for // the constant. // // Range = [Lower, Upper] U (MayBeQNaN ? QNaN : {}) U (MayBeSNaN ? SNaN : {}) // Specifically, [inf, -inf] represents an empty set. // Note: // 1. Bounds are inclusive. // 2. -0 is considered to be less than 0. That is, range [0, 0] doesn't contain // -0. // 3. Currently wrapping ranges are not supported. // //===----------------------------------------------------------------------===// #ifndef LLVM_IR_CONSTANTFPRANGE_H #define LLVM_IR_CONSTANTFPRANGE_H #include "llvm/ADT/APFloat.h" #include "llvm/IR/Instructions.h" #include <optional> namespace llvm { class raw_ostream; struct KnownFPClass; /// This class represents a range of floating-point values. class [[nodiscard]] ConstantFPRange { … }; inline raw_ostream &operator<<(raw_ostream &OS, const ConstantFPRange &CR) { … } } // end namespace llvm #endif // LLVM_IR_CONSTANTFPRANGE_H