[TTI] getMinMaxReductionCost - add FastMathFlag argument
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 13 Apr 2023 09:42:36 +0000 (10:42 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 13 Apr 2023 09:42:42 +0000 (10:42 +0100)
commit9e30b87afb75e589f8df105a696e8641320aeefe
treecef7d79372ef3c39c85a498144e14681c252a1ec
parente3175f7f1b55a38e9ab845ca26f0c4343ee2f7ff
[TTI] getMinMaxReductionCost - add FastMathFlag argument

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 (63c3895327839ba5b57f5b99ec9e888abf976ac6).

Differential Revision: https://reviews.llvm.org/D148149
13 files changed:
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/lib/Target/X86/X86TargetTransformInfo.h
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp