[llvm] [LLVM][IR] Add constant range support for floating-point types (PR #86483)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 15 03:27:43 PDT 2024
================
@@ -0,0 +1,188 @@
+//===- 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: -0 is considered to be less than 0. That is, range [0, 0] doesn't
+// contain -0.
----------------
nikic wrote:
This comment should explicitly say that the bounds are inclusive, and whether wrapping ranges are supported.
https://github.com/llvm/llvm-project/pull/86483
More information about the llvm-commits
mailing list