Skip to content

Commit ed73405

Browse files
committed
Add comment
1 parent cb6f1d3 commit ed73405

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2778,7 +2778,19 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
27782778
}
27792779
case Intrinsic::maximumnum:
27802780
case Intrinsic::minimumnum: {
2781-
if (TLI->isOperationLegalOrPromote(llvm::ISD::FMAXNUM_IEEE, LT.second))
2781+
// On platform that support FMAXNUM_IEEE/FMINNUM_IEEE, we expand
2782+
// maximumnum/minimumnum to
2783+
// ARG0 = fcanonicalize ARG0, ARG0 // to quiet ARG0
2784+
// ARG1 = fcanonicalize ARG1, ARG1 // to quiet ARG1
2785+
// RESULT = MAXNUM_IEEE ARG0, ARG1 // or MINNUM_IEEE
2786+
// Here fcanonicalize may be FMAXNUM_IEEE or FMINNUM_IEEE varies by
2787+
// architecture.
2788+
// FIXME: In LangRef, we claimed FMAXNUM has the same behaviour of
2789+
// FMAXNUM_IEEE, while the backend hasn't migrated the code yet.
2790+
// Finally, we will remove FMAXNUM_IEEE and FMINNUM_IEEE.
2791+
// All known platforms have both FMAXNUM_IEEE and FMINNUM_IEEE, so we
2792+
// check MAX only.
2793+
if (TLI->isOperationLegalOrPromote(ISD::FMAXNUM_IEEE, LT.second))
27822794
return LT.first * 3;
27832795
break;
27842796
}

0 commit comments

Comments
 (0)