[llvm] [LLVM][IR] Add constant range support for floating-point types (PR #86483)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 08:32:37 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.
----------------
dtcxzyw wrote:

Done.

https://github.com/llvm/llvm-project/pull/86483


More information about the llvm-commits mailing list