This is an archive of the discontinued LLVM Phabricator instance.

TTI: Improve default costs for addrspacecast
ClosedPublic

Authored by arsenm on May 24 2019, 10:04 AM.

Details

Reviewers
hfinkel
Summary

For some reason multiple places need to do this, and the variant the
loop unroller and inliner use was not handling it.

Also, introduce a new wrapper to be slightly more precise, since on
AMDGPU some addrspacecasts are free, but not no-ops.

Diff Detail

Event Timeline

arsenm created this revision.May 24 2019, 10:04 AM
hfinkel added inline comments.Jun 3 2019, 10:28 AM
include/llvm/CodeGen/TargetLowering.h
1591

Do you indent for targets to override this separately from isCheapAddrSpaceCast? You didn't make it virtual. I'd be happy renaming Cheap to Free and just saying that, in CGP, we only sink free addrspacecasts.

arsenm marked an inline comment as done.Jun 3 2019, 10:41 AM
arsenm added inline comments.
include/llvm/CodeGen/TargetLowering.h
1591

Renaming cheap to free would be fine for me

hfinkel accepted this revision.Jun 3 2019, 10:51 AM
hfinkel added inline comments.
include/llvm/CodeGen/TargetLowering.h
1591

Great. With that done, this LGTM.

This revision is now accepted and ready to land.Jun 3 2019, 10:51 AM
arsenm closed this revision.Jun 3 2019, 11:39 AM

r362436