This is an archive of the discontinued LLVM Phabricator instance.

[TTI] getMinMaxReductionCost - add FastMathFlag argument
ClosedPublic

Authored by RKSimon on Apr 12 2023, 10:55 AM.

Details

Summary

Similar to the getArithmeticReductionCost / getExtendedReductionCost calls (which really don't need to use std::optional<>).

This will be necessary to correct recognize fast/nnan fmax/fmul reductions which can avoid nan handling - which will allow us to remove the fmax/fmin special case in X86TTIImpl::getMinMaxCost and use getIntrinsicInstrCost like we do for integer reductions (rG63c3895327839ba5b57f5b99ec9e888abf976ac6).

Diff Detail

Event Timeline

RKSimon created this revision.Apr 12 2023, 10:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 10:55 AM
RKSimon requested review of this revision.Apr 12 2023, 10:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 10:55 AM
This revision is now accepted and ready to land.Apr 12 2023, 10:58 AM
nikic added a subscriber: nikic.Apr 12 2023, 12:07 PM
nikic added inline comments.
llvm/include/llvm/Analysis/TargetTransformInfo.h
1395

Why do we need the std::optional wrapper? FMF already has a value to represent no FMF.

RKSimon added inline comments.Apr 12 2023, 12:20 PM
llvm/include/llvm/Analysis/TargetTransformInfo.h
1395

I was wondering the same thing - I matched what was already done by the sibling methods - I'll investigate stripping it

RKSimon updated this revision to Diff 513135.Apr 13 2023, 2:40 AM
RKSimon retitled this revision from [TTI] getMinMaxReductionCost - add std::optional<FastMathFlags> argument to [TTI] getMinMaxReductionCost - add FastMathFlag argument.
RKSimon edited the summary of this revision. (Show Details)

Drop std::optional<>

This revision was landed with ongoing or failed builds.Apr 13 2023, 2:44 AM
This revision was automatically updated to reflect the committed changes.