@@ -60,28 +60,6 @@ static APFloat fmed3AMDGCN(const APFloat &Src0, const APFloat &Src1,
60
60
return maxnum (Src0, Src1);
61
61
}
62
62
63
- enum class KnownIEEEMode { Unknown, On, Off };
64
-
65
- // / Return KnownIEEEMode::On if we know if the use context can assume
66
- // / "amdgpu-ieee"="true" and KnownIEEEMode::Off if we can assume
67
- // / "amdgpu-ieee"="false".
68
- static KnownIEEEMode fpenvIEEEMode (const Instruction &I,
69
- const GCNSubtarget &ST) {
70
- if (!ST.hasIEEEMode ()) // Only mode on gfx12
71
- return KnownIEEEMode::On;
72
-
73
- const Function *F = I.getFunction ();
74
- if (!F)
75
- return KnownIEEEMode::Unknown;
76
-
77
- Attribute IEEEAttr = F->getFnAttribute (" amdgpu-ieee" );
78
- if (IEEEAttr.isValid ())
79
- return IEEEAttr.getValueAsBool () ? KnownIEEEMode::On : KnownIEEEMode::Off;
80
-
81
- return AMDGPU::isShader (F->getCallingConv ()) ? KnownIEEEMode::Off
82
- : KnownIEEEMode::On;
83
- }
84
-
85
63
// Check if a value can be converted to a 16-bit value without losing
86
64
// precision.
87
65
// The value is expected to be either a float (IsFloat = true) or an unsigned
@@ -1004,7 +982,7 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
1004
982
// TODO: Also can fold to 2 operands with infinities.
1005
983
if ((match (Src0, m_APFloat (ConstSrc0)) && ConstSrc0->isNaN ()) ||
1006
984
isa<UndefValue>(Src0)) {
1007
- switch (fpenvIEEEMode (II, *ST )) {
985
+ switch (fpenvIEEEMode (II)) {
1008
986
case KnownIEEEMode::On:
1009
987
// TODO: If Src2 is snan, does it need quieting?
1010
988
if (ConstSrc0 && ConstSrc0->isSignaling ())
@@ -1019,7 +997,7 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
1019
997
}
1020
998
} else if ((match (Src1, m_APFloat (ConstSrc1)) && ConstSrc1->isNaN ()) ||
1021
999
isa<UndefValue>(Src1)) {
1022
- switch (fpenvIEEEMode (II, *ST )) {
1000
+ switch (fpenvIEEEMode (II)) {
1023
1001
case KnownIEEEMode::On:
1024
1002
// TODO: If Src2 is snan, does it need quieting?
1025
1003
if (ConstSrc1 && ConstSrc1->isSignaling ())
@@ -1035,7 +1013,7 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
1035
1013
}
1036
1014
} else if ((match (Src2, m_APFloat (ConstSrc2)) && ConstSrc2->isNaN ()) ||
1037
1015
isa<UndefValue>(Src2)) {
1038
- switch (fpenvIEEEMode (II, *ST )) {
1016
+ switch (fpenvIEEEMode (II)) {
1039
1017
case KnownIEEEMode::On:
1040
1018
if (ConstSrc2 && ConstSrc2->isSignaling ()) {
1041
1019
auto *Quieted = ConstantFP::get (II.getType (), ConstSrc2->makeQuiet ());
0 commit comments