[llvm] fd63a7d - Revert "ValueTracking: Handle freeze in computeKnownFPClass"
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 17 03:59:31 PDT 2023
Author: Nikita Popov
Date: 2023-04-17T12:59:23+02:00
New Revision: fd63a7d5c8a6b6b86546ef5427f3c0485fdf9bd3
URL: https://github.com/llvm/llvm-project/commit/fd63a7d5c8a6b6b86546ef5427f3c0485fdf9bd3
DIFF: https://github.com/llvm/llvm-project/commit/fd63a7d5c8a6b6b86546ef5427f3c0485fdf9bd3.diff
LOG: Revert "ValueTracking: Handle freeze in computeKnownFPClass"
This reverts commit 2c8d0048f03d054f13909a26f959ef95b2a0a4de.
This is incorrect: computeKnownFPClass() is only known up to
poison, and freeze poison may have any FP class.
Added:
Modified:
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/Attributor/nofpclass.ll
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index eae6261cfe131..2578957277155 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -4635,8 +4635,7 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
break;
}
- case Instruction::ExtractValue:
- case Instruction::Freeze: {
+ case Instruction::ExtractValue: {
computeKnownFPClass(Op->getOperand(0), DemandedElts, InterestedClasses,
Known, Depth + 1, Q, TLI);
break;
diff --git a/llvm/test/Transforms/Attributor/nofpclass.ll b/llvm/test/Transforms/Attributor/nofpclass.ll
index 6ac9baf57eacc..52c9c2e12fdb0 100644
--- a/llvm/test/Transforms/Attributor/nofpclass.ll
+++ b/llvm/test/Transforms/Attributor/nofpclass.ll
@@ -884,27 +884,3 @@ define float @returned_extractvalue([4 x float] nofpclass(nan) %array) {
%extract = extractvalue [4 x float] %array, 0
ret float %extract
}
-
-define float @return_nofpclass_freeze_nan_arg(float nofpclass(nan) %arg) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none)
-; CHECK-LABEL: define noundef nofpclass(nan) float @return_nofpclass_freeze_nan_arg
-; CHECK-SAME: (float nofpclass(nan) [[ARG:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT: [[FREEZE:%.*]] = freeze float [[ARG]]
-; CHECK-NEXT: ret float [[FREEZE]]
-;
- %freeze = freeze float %arg
- ret float %freeze
-}
-
-define float @return_nofpclass_extractelement_freeze_pinf_arg(<2 x float> nofpclass(pinf) %arg) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none)
-; CHECK-LABEL: define noundef nofpclass(pinf) float @return_nofpclass_extractelement_freeze_pinf_arg
-; CHECK-SAME: (<2 x float> nofpclass(pinf) [[ARG:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT: [[FREEZE:%.*]] = freeze <2 x float> [[ARG]]
-; CHECK-NEXT: [[ELT:%.*]] = extractelement <2 x float> [[FREEZE]], i32 0
-; CHECK-NEXT: ret float [[ELT]]
-;
- %freeze = freeze <2 x float> %arg
- %elt = extractelement <2 x float> %freeze, i32 0
- ret float %elt
-}
More information about the llvm-commits
mailing list