[CostModel][X86] Add SREM/UREM general and constant costs (PR38056)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 7 Jul 2018 16:53:30 +0000 (16:53 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 7 Jul 2018 16:53:30 +0000 (16:53 +0000)
commitdc113dc7ed08e28c241dcf3b85055a75dff53ffd
tree8468dc940b6077006348a16134a86d1b73c6a969
parent1d27406135d541db5536fbeabd09b65c4ba618ba
[CostModel][X86] Add SREM/UREM general and constant costs (PR38056)

We penalize general SDIV/UDIV costs but don't do the same for SREM/UREM.

This patch makes general vector SREM/UREM x20 as costly as scalar, the same approach as we do for SDIV/UDIV. The patch also extends the existing SDIV/UDIV constant costs for SREM/UREM - at the moment this means the additional cost of a MUL+SUB (see D48975).

Differential Revision: https://reviews.llvm.org/D48980

llvm-svn: 336486
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/test/Analysis/CostModel/X86/rem.ll