[TTI] Remove default condition type and predicate arguments from getCmpSelInstrCost
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 6 Oct 2021 14:37:05 +0000 (15:37 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 6 Oct 2021 14:40:35 +0000 (15:40 +0100)
commit0dcd2b40e6879542d708fdb9dcfdcbcaffdc2ce7
treecc3909d5eaccb377c89a48dd2bf8751137ea59f0
parent49dbde9c9e5149bcc8b906f7dbd040be76a2a267
[TTI] Remove default condition type and predicate arguments from getCmpSelInstrCost

We need to be better at exposing the comparison predicate to getCmpSelInstrCost calls as some targets (e.g. X86 SSE) have very different costs for different comparisons (PR48337), and we can't always rely on the optional Instruction argument.

This initial commit requires explicit condition type and predicate arguments. The next step will be to review a lot of the existing getCmpSelInstrCost calls which have used BAD_ICMP_PREDICATE even when the predicate is known.

Differential Revision: https://reviews.llvm.org/D111024
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Transforms/Utils/LoopUtils.h
llvm/lib/Transforms/Utils/LoopUtils.cpp
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/lib/Transforms/Vectorize/VectorCombine.cpp
llvm/test/Transforms/VectorCombine/X86/extract-cmp-binop.ll
llvm/test/Transforms/VectorCombine/X86/extract-cmp.ll
llvm/test/Transforms/VectorCombine/X86/scalarize-cmp-inseltpoison.ll
llvm/test/Transforms/VectorCombine/X86/scalarize-cmp.ll