@@ -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
@@ -1003,7 +981,7 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
1003
981
// TODO: Also can fold to 2 operands with infinities.
1004
982
if ((match (Src0, m_APFloat (ConstSrc0)) && ConstSrc0->isNaN ()) ||
1005
983
isa<UndefValue>(Src0)) {
1006
- switch (fpenvIEEEMode (II, *ST )) {
984
+ switch (fpenvIEEEMode (II)) {
1007
985
case KnownIEEEMode::On:
1008
986
// TODO: If Src2 is snan, does it need quieting?
1009
987
if (ConstSrc0 && ConstSrc0->isSignaling ())
@@ -1018,7 +996,7 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
1018
996
}
1019
997
} else if ((match (Src1, m_APFloat (ConstSrc1)) && ConstSrc1->isNaN ()) ||
1020
998
isa<UndefValue>(Src1)) {
1021
- switch (fpenvIEEEMode (II, *ST )) {
999
+ switch (fpenvIEEEMode (II)) {
1022
1000
case KnownIEEEMode::On:
1023
1001
// TODO: If Src2 is snan, does it need quieting?
1024
1002
if (ConstSrc1 && ConstSrc1->isSignaling ())
@@ -1034,7 +1012,7 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
1034
1012
}
1035
1013
} else if ((match (Src2, m_APFloat (ConstSrc2)) && ConstSrc2->isNaN ()) ||
1036
1014
isa<UndefValue>(Src2)) {
1037
- switch (fpenvIEEEMode (II, *ST )) {
1015
+ switch (fpenvIEEEMode (II)) {
1038
1016
case KnownIEEEMode::On:
1039
1017
if (ConstSrc2 && ConstSrc2->isSignaling ()) {
1040
1018
auto *Quieted = ConstantFP::get (II.getType (), ConstSrc2->makeQuiet ());
0 commit comments