Page MenuHomePhabricator

[CostModel] Make target intrinsics cheap by default
ClosedPublic

Authored by dmgreen on Nov 2 2020, 5:20 AM.

Details

Summary

This patch changes the intrinsics cost model to assume that by default target intrinsics are cheap. This didn't seem to be the case for all intrinsics, and is potentially an MVE problem due to our scalarization overheads. Cheap seems to be a good default in general though.

Found from D90554, which would also end up changing the size costs which then has an effect on loop unrolling and unswitch.

Diff Detail

Event Timeline

dmgreen created this revision.Nov 2 2020, 5:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2020, 5:20 AM
dmgreen requested review of this revision.Nov 2 2020, 5:20 AM
spatel added inline comments.Nov 2 2020, 5:43 AM
llvm/include/llvm/CodeGen/BasicTTIImpl.h
1137–1142

Do you see any differences if we add the check here?
I've been staring at and stepping through this code for days, and I'm still not exactly sure how it works...
But it seems like if we can stub something out at this level, it's better than waiting for the type-based specialization.

dmgreen updated this revision to Diff 302274.Nov 2 2020, 7:18 AM

Yeah that makes sense. My tests were not unhappy about moving it.

spatel accepted this revision.Nov 2 2020, 7:44 AM

LGTM

This revision is now accepted and ready to land.Nov 2 2020, 7:44 AM
This revision was automatically updated to reflect the committed changes.