arsenm wrote:
Next piece in #81108
https://github.com/llvm/llvm-project/pull/74056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/74056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/74056
>From 9be777d5b39852cf3c0b2538fd5f712922672caa Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Fri, 1 Dec 2023 18:00:13 +0900
Subject: [PATCH 1/4] Reapply "InstCombine: Introduce
SimplifyDemandedUseFPClass""
https://github.com/dtcxzyw approved this pull request.
LGTM. Thanks!
https://github.com/llvm/llvm-project/pull/74056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
dtcxzyw wrote:
> > I don't know why it fails:
> > ```
> > error: patch failed:
> > llvm/lib/Transforms/InstCombine/InstCombineInternal.h:551
> > error: llvm/lib/Transforms/InstCombine/InstCombineInternal.h: patch does
> > not apply
> > error: patch failed:
> >
arsenm wrote:
> I don't know why it fails:
>
> ```
> error: patch failed: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:551
> error: llvm/lib/Transforms/InstCombine/InstCombineInternal.h: patch does not
> apply
> error: patch failed:
>
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
https://github.com/dtcxzyw requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/74056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1877,3 +1877,139 @@ Value
*InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
return MadeChange ? I : nullptr;
}
+
+/// For floating-point classes that resolve to a single bit pattern, return
that
+/// value.
+static Constant *getFPClassConstant(Type *Ty,
https://github.com/dtcxzyw edited
https://github.com/llvm/llvm-project/pull/74056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
dtcxzyw wrote:
> > @arsenm Can you rebase this patch first?
>
> It was already fresh, I just re-merged again with no conflicts
I don't know why it fails:
```
error: patch failed: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:551
error:
arsenm wrote:
> @arsenm Can you rebase this patch first?
It was already fresh, I just re-merged again with no conflicts
https://github.com/llvm/llvm-project/pull/74056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/74056
>From 9be777d5b39852cf3c0b2538fd5f712922672caa Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Fri, 1 Dec 2023 18:00:13 +0900
Subject: [PATCH 1/2] Reapply "InstCombine: Introduce
SimplifyDemandedUseFPClass""
andykaylor wrote:
For those who haven't already seen it, there was a related discussion here:
https://discourse.llvm.org/t/should-isnan-be-optimized-out-in-fast-math-mode/5
I think that discussion could be fairly summarized by saying that no consensus
was reached, and many people wished
andykaylor wrote:
It seems like there are two possible interpretations of -ffinite-math-only:
1. There will be no NaN or inf values seen anywhere in the program (other than
loads and stores?).
2. No floating-point operation (other than compares?) will have NaN or inf
inputs or results.
The
jayfoad wrote:
> The referenced issue violates the spec for finite-only math only by
> using a return value for a constant infinity.
You mean this issue?
https://github.com/llvm/llvm-project/commit/5a36904c515b#commitcomment-129847939
Can you explain how your patch "broke" it? If you return
https://github.com/jcranmer-intel commented:
There's probably some useful discussion to be had about how aggressive
`-ffinite-math-only` at the clang level should be wrt lowering to `nnan`/`ninf`
in the IR.
It may be worth deferring the ReturnInst changes (but landing everything else)
until
llvmbot wrote:
@llvm/pr-subscribers-llvm-analysis
Author: Matt Arsenault (arsenm)
Changes
This reverts commit ef388334ee5a3584255b9ef5b3fefdb244fa3fd7.
The referenced issue violates the spec for finite-only math only by
using a return value for a constant infinity. If the interpretation
28 matches
Mail list logo