This is an archive of the discontinued LLVM Phabricator instance.

[CostModel][X86] Add SREM/UREM general and constant costs (PR38056)
ClosedPublic

Authored by RKSimon on Jul 5 2018, 10:22 AM.

Details

Summary

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).

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Jul 5 2018, 10:22 AM
ABataev accepted this revision.Jul 5 2018, 10:33 AM

LG with a nit

lib/Target/X86/X86TargetTransformInfo.cpp
270–275 ↗(On Diff #154260)

You can drop 2 last arguments from these functions calls

This revision is now accepted and ready to land.Jul 5 2018, 10:33 AM
This revision was automatically updated to reflect the committed changes.