[llvm] [ConstantFPRange] Implement `ConstantFPRange::makeAllowedFCmpRegion` (PR #110082)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 19:48:23 PDT 2024


================
@@ -103,11 +103,115 @@ ConstantFPRange ConstantFPRange::getNaNOnly(const fltSemantics &Sem,
                          MayBeSNaN);
 }
 
+ConstantFPRange ConstantFPRange::getNonNaN(const fltSemantics &Sem) {
+  return ConstantFPRange(APFloat::getInf(Sem, /*Negative=*/true),
+                         APFloat::getInf(Sem, /*Negative=*/false),
+                         /*MayBeQNaN=*/false, /*MayBeSNaN=*/false);
+}
+
+/// Return [-inf, V) or [-inf, V]
+static ConstantFPRange makeLessThan(APFloat V, FCmpInst::Predicate Pred) {
+  const fltSemantics &Sem = V.getSemantics();
+  if (!(Pred & FCmpInst::FCMP_OEQ)) {
----------------
dtcxzyw wrote:

Fixed.

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


More information about the llvm-commits mailing list